just wondering how I can check to see if a text variable is contained within another variable. like
var A = "J";
var B = "another J";
something like :contains but for variables.
thanks
You want to check if one string belongs into another? You can use regular expresions or strpos like function
function strpos( haystack, needle, offset){
var i = (haystack+'').indexOf(needle, (offset ? offset : 0));
return i === -1 ? false : i;
}
To my knowledge jQuery doesn't have a native function for doing what you want.