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

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -