javascript - My js function doesn't work -


i trying write js function changes text of html tag:

<html>      <body>      <p id="myid"></p>      <script>    function print(objtowriteon, text {document.getelementbyid(objtowriteon).innerhtml = text;}print("myid", "hello, world");   </script>  </body></html> 

i don't know why, when run code doesn't work... know how solve problem?

syntex error there, use correct syntex like.

<html>      <body>      <p id="myid"></p>      <script>    function print(objtowriteon, text) {      document.getelementbyid(objtowriteon).innerhtml = text;};      print("myid", "hello, world");   </script>  </body></html> 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -