jquery val() contains()

后端 未结 5 1563
青春惊慌失措
青春惊慌失措 2021-02-18 17:40

I want to know if the textarea value contains a certain word. This is not working for me.

var value = $(\'#embedModal textarea\').val();
if($(value).contains(\'i         


        
5条回答
  •  执笔经年
    2021-02-18 18:11

    Try following code.....

    code:

                 
                 
    
                   var obj=$("textarea:contains('iframe')");
    
                       if(obj){
    
                                obj.css("background-color", "red");
    
                             }
    

提交回复
热议问题