Organizational Research By

Surprising Reserch Topic

jquery find versus context selection

jquery find versus context selection  using -'jquery,jquery-selectors'

Having the following html snippet

<div class="something">
    <p>Some text</p>
<div class="somethingElse">
    <p>some other text</p>

I think the following jquery snippets are identical (will have the same result):

$(".something").find("p").css("border", "1px solid red");

$("p", ".something").css("border", "1px solid red");

My question is, whether one snippet is better than the other and should be used

asked Oct 19, 2015 by abhimca2006
0 votes
1 view

Related Hot Questions

Government Jobs Opening