I’ve been trying to code something in Javascript inside of Notebook ++ but when I open it in a web browser (Chrome or Internet Explorer), the function of the script doesn’t work.
For instance:
Change button/h1>
This will change button
Click Me!
This is a demonstration.
function myFunction() { document.getElementById("demo").innerHTML = "Hello JavaScript!"; }
You see everything but when I click on the icon for the button, it doesn’t work. What am I doing wrong?
Thanks!
the code I'm posting is being stripped for some reason. I had much more than in my response to the initial comment.
Seeing the code section will help us understand what you have written.
But yiu should have a div whose id = demo
And onclick =
For it to work
There are some similar clicks n buttons on a page where I post photos
http://www.movingpostcards.tv
Obvious question, but are you actually calling the function? Also, is there anything in your console?
I agree with Oron. We need a bit more context to help you.
Oron, there is a sample below of a short one. Thanks.
Java
Click me to display Date and Time.
Ragu, can you post the _entire_ code of a page (preferably a short one) so we can see it in context?