Change Placeholder Text using jQuery

后端 未结 13 1232
-上瘾入骨i
-上瘾入骨i 2020-12-04 06:17

I am using a jQuery placeholder plugin(https://github.com/danielstocks/jQuery-Placeholder). I need to change the placeholder text with the change in dropdown menu. But it is

13条回答
  •  失恋的感觉
    2020-12-04 06:48

    $(document).ready(function(){ 
      $('form').find("input[type=textarea], input[type=password], textarea").each(function(ev)
      {
          if(!$(this).val()) { 
         $(this).attr("placeholder", "Type your answer here");
      }
      });
    });
    

    Copy and paste this code in your js file, this will change all placeholder text from whole site.

提交回复
热议问题