Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,554 members, 7,819,960 topics. Date: Tuesday, 07 May 2024 at 07:33 AM

Please Guys Help Me With This Javascript Problem - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Please Guys Help Me With This Javascript Problem (408 Views)

Please Guys Help Me Criticize My New Forum Site Design / Please I Need Help With This Javascript Issue / Please Guys I Need Photoshop. Who Can Send To Me? (2) (3) (4)

(1) (Reply)

Please Guys Help Me With This Javascript Problem by Stephenben(m): 9:37am On Oct 02, 2017
I can't seem to get this JavaScript right.. Been trying out the code for it to work but its not responding.. It was working with other codes but this particular code. It ain't working..


<DOCTYPE html>
<html>
<body>
<h1>JavaScript</h1>
<p id="love"> I love JavaScript</p>
<p id="fun">It's so fun</p>
<button type="button" onclick="myFunction()">New Codes</button>
<script>
function myFunction()
{
document.getElementById("love"wink.innerHTML="I love html";
document.getElementById("fun"wink.innerHTML="It's so cool";
</script>
<p> Click button to change the words</p>
Re: Please Guys Help Me With This Javascript Problem by Prec1ous(m): 9:46am On Oct 02, 2017
Try this code instead

<DOCTYPE html>
<html>
<body>
<h1>JavaScript</h1>
<p id="love"> I love JavaScript</p>
<p id="fun">It's so fun</p>
<button type="button" onclick="myFunction()">New Codes</button>
<script>
function myFunction()
{
document.getElementById("love"wink.innerHTML="I love html";
document.getElementById("fun"wink.innerHTML="It's so cool";
}
</script>
<p> Click button to change the words</p>[/quote]
Re: Please Guys Help Me With This Javascript Problem by Stephenben(m): 2:10pm On Oct 02, 2017
Thanks bro.. I found my error.. I didn't add the closing curly bracket }

(1) (Reply)

Why You Shouldn’t Rely On One Internet Service Provider / Free Online Training For Html/css, Javascript, Jquery, Mysql, Php, Java, Android / Mistakes To Avoid When Using Web Templates

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 9
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.