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
Post a Comment