How to find the input element in my html markup
I am trying to use regular expression to find if the variable contains an
input field.
My html in my variable could be something like this.
<span>test here</span>
or
<span><input tyep="text"></span>
My codes are like
//$(this) is be my variable
if($(this).html().match("/<input type='text'>/")){
console.log('match found')
}
It doesn't seem to be able to find the match. Can anyone help me about it?
thanks a lot!
No comments:
Post a Comment