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

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -