Tip: How to add placeholder to textarea in Ninja Forms Wordpress plugin -


this not question. felt needed share small piece of magic peeps out there having hard time getting placeholder in ninja forms textarea field.

so, need add following code header.php file in head section, change id of textarea , choose placeholder text.

<script type="text/javascript">     jquery(document).ready(function($){         $('#yourtextareaid').attr("placeholder","your placeholder value");     }); </script> 

hope can save time. can thank me later.

a way of doing make work textarea set (in ninja forms) default value of textarea whatever want placeholder , on page load, take content of each textarea, add placeholder attribute, remove content:

$(document).ready(function() {     // remove textarea content , add placeholder     $("textarea").each(function() {         var $this = $(this);         $this.attr("placeholder", $this.val());         $this.val("");     }); }); 

Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -