Select div from row with jquery

I have a line that contains some div, how to get one of them by id?

EDIT

I use the right-click select plugin, so when I select a div.

 $("#first #second").contextMenu({
        menu: 'myMenu'
    },
        function(action, el, pos) {
      switch (action) {
            case "do":
                {

and the choice is basicley

$(el).html()

So, this is code that contains html that is in # second, but # second is not one div, it is a'lot divs with this id, and I want when I click on this div to select a specific identifier and get its context . Is there an easier way?

+3
source share
2 answers

In your case, you can wrap eland go from it, for example:

$(el).find('.something-else').blah(); // ...

el not a string, this is a DOM element.

- $(el).html(). , , HTML-, DOM, .

+1

jquery , :

$(htmlstring);

- :

$("<div><div id='test'></div></div>").find("#test");

Edit: , , , .

. .

+4

All Articles