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

javascript - three.js lot of meshes optimization -

smartface.io - Proper way to change color scheme for whole application -

Email notification in google apps script -