Home How to call js jQuery from functions.php in Wordpress
Reply: 0

How to call js jQuery from functions.php in Wordpress

user5122
1#
user5122 Published in September 19, 2018, 11:02 am

I have this code on Wordpress post:

<input type=text id="testni" value="la">

and this code in functions.php:

<script type="text/javascript">
          $function(){
        $("#testni").attr("value", "petra");


          }
        </script>

This does not work. I guess i have to add some php code?

How to call JS from php?

share|improve this question
  • 3
    $(function(){ $("#testni").val("petra"); }), Use .val() to set value and correct DOM ready handler – Satpal Apr 17 at 11:37

2 Answers 2

active oldest votes
up vote 1 down vote accepted
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.323093 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO