I have a small script.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("button").click(function(){
$( "p" ).first().replaceWith("Hello world!");
});
});
</script>
</head>
<body>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
<button>Replace the first p element with new text</button>
This replaces the content inside the first
with "Hello world!".
I got same result with 2 jquery script.
1) ( "p:first" )
2) ("p").first()
What is the exact difference between these 2 scripts.