Selecting elements in jquery

Suppose we have following html page containing different elements with different conditions.....

<html>
<head><title>Selecting elements in jquery</title>
<script src="jquery.js"     language="javascript"></script>
<style>
.c1{
color:#ff0000;
}
</style>
</head>
<body>
<p>Making paragrph</p>
<span class="c1">Selecting elements with class</span>
<div id="box">Hello I am in div </div>
<form name="frm">
<input type="text" name="txt" value="Hello"><br/>
<input type="checkbox" name="chk" value="123"><br/>
</form>
<div id="result">
</div>
</body>
</html>

Now we may access these elements through jquery as
  1. For accessing html element use $("tag_name") i.e.  $("p").
  2. For accessing element with class use $(".class_name") i.e. $(".c1")
  3. For accessing element with id use $("#id") i.e. $("#box")

<html>
<head><title>Selecting elements in jquery</title>
<script src="jquery.js"     language="javascript"></script>
<script language="javascript">
$("document").ready(function(){
var txt="";
// selecting p text without id and class
    txt+=$("p").text()+"<br/>";
// selecting p text with class
    txt+=$(".c1").text()+"<br/>";
// selecting p text with id
    txt+=$("#box").text()+"<br/>";
// selecting form elements
    txt+=$("input[name='txt']").val()+"<br/>";
    txt+=$("input[name='chk']").val()+"<br/>";
/// after selecting final result in div with id result
    $("#result").html(txt);
});
</script>
<style>
.c1{
color:#ff0000;
}
</style>
</head>
<body>
<p>Making paragraph</p>

<span class="c1">Selecting elements with class</span>

<div id="box">Hello I am in div </div>

<form name="frm">

<input type="text" name="txt" value="Hello"><br/>
<input type="checkbox" name="chk" value="123"><br/>

<div id="result">
</div>

</form>
</body>
</html>