so, i have something like this.
var $list = $("div#item");
I was looking at :contains in the selector, but i wasnt sure if that applied to markup or if i should do something like:
if($list.find("<b>"))return 1;
else return 0;
Reasoning: Adding functionality to a program which uses inline tags, and want to maintain structure.
Goal: if(item contains an inline b, u, i tags) return 1; else return 0;
You can simplify it down to a single selector
.find("b,i,u")and return the boolean comparisonlength > 0. If any of the tags<b><i><u>are found inside#item, the overall length will be> 0:Proof of concept
Edit: If you really want a
numberzero or one back instead of theboolean, use a ternary: