javascript - Check if selector contains text (ie. is not media) in jQuery -
is there way use jquery see if selector text based field.
ie. when user clicks element, check if it's element contain text , not image, video etc.
what best way achieve in jquery?
you have test element children know if 1 of them contain non-text element.
if ($(this).find("img,video,object").length==0) { alert("i text element"); } else { alert("i not text element"); }
and might have test element if can trigger click event.
Comments
Post a Comment