javascript - Deleting an element based on window width -


var $linkfullwidth = $('div.image--link');  if($(window).width() < 768){     // delete element $linkfullwidth } 

how go targeting element , deleting it?

and valid javascript?

thanks!

remove element jquery since using it.

$('#linkfullwidth').remove(); //if elements id linkfullwidth 

or

$('.linkfullwidth').remove(); //if elements class linkfullwidth(will delete elements class though) 

since caching in variable then

$($linkfullwidth).remove(); //would job fine 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

c# - Retrieve google contact -

javascript - How to insert selected radio button value into table cell -