jquery - Adding placeholder attribute to input HTML -
i'm attempting add placeholder attribute multiple input tags unique classes in form. form generated plugin can't add attribute in manually. unfortunately nothing have tried has worked. because each placeholder different i'm address each 1 separately...
here's html
<input class="name-field" type="text" id="yourname_38_1" name="yourname" value="">
the jquery i'm using
$(".name-field").attr("placeholder", "name");
when in console following referring line jquery on.
uncaught typeerror: $ not function
my understanding of jquery basic. please help
thank in advance.
dave
you need load jquery plugin.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
please add line above <script></script>
tag.
Comments
Post a Comment