jquery val() contains()

后端 未结 5 1588
青春惊慌失措
青春惊慌失措 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:23

    this works:

    $.contains( document.documentElement, document.body ); // true
    
    var babyEl = $('div#id');
    var daddyEl = $('div#ID');
    
    if($.contains(babyEl, daddyEl)) {
        //do fun stuff
    }
    

提交回复
热议问题