jquery - Filter element stored in variable by class -
I have elements stored in a variable (var body). Take the form of these elements:
& lt; p class = 'txt' & gt; & Lt; / P & gt; Or & lt; p class = 'img' & gt; & Lt; / P & gt; I will have to pass like a 'body' in a function and only return that element if its class is 'IMG'.
If I correctly understand:
$ (body ) .hasClass ('img'); Or maybe:
$ (body) .filter ('. Img');
Comments
Post a Comment