Why is my inner HTML not changing? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why is my inner HTML not changing?

please have a look at my login code and see javascript section https://code.sololearn.com/WCVEv9GdqfrZ/?ref=app

20th Apr 2017, 9:22 AM
AdamWhiz
AdamWhiz - avatar
9 Answers
+ 26
onload=function(){document.getElementById("submit").innerHTML="yolk";};
20th Apr 2017, 9:33 AM
Valen.H. ~
Valen.H. ~ - avatar
+ 25
onload=function(){ document.getElementById("submit").onClick = function() { document.getElementById("submit").innerHTML = "yolk"; }};
21st Apr 2017, 5:18 AM
Valen.H. ~
Valen.H. ~ - avatar
+ 12
window.onload = function() { document.getElementById("submit").innerHTML = "yolk"; }
20th Apr 2017, 9:36 AM
Kailash Loncha
Kailash Loncha - avatar
+ 5
@Abram - when you have a submit() button in a form, you need to add an action and method (though 'get' seems to be the default): <form action="where-to-submit" method="post or get" ... > Your code doesn't know where to submit, so it sends this (I just hit the button): about:blank?username=&password=&StayLoggedIn=on&submit= Note, you "named" your submit button--that makes it a form variable too. (Output is from Intent Intercept for Android)
22nd Apr 2017, 2:03 PM
Kirk Schafer
Kirk Schafer - avatar
+ 4
onsubmit="somefunc(); return false;" didn't mean to hijack this thread
22nd Apr 2017, 2:12 PM
Kirk Schafer
Kirk Schafer - avatar
0
Awesome, thanks for getting back to me. Now I don't wanna be too annoying but I've updated the code to work on an onclick function but that doesn't seem to work now! help! :)
20th Apr 2017, 8:02 PM
AdamWhiz
AdamWhiz - avatar
0
so all javascript needs to be inside an onload event??
21st Apr 2017, 8:15 AM
AdamWhiz
AdamWhiz - avatar
0
thanks but that doesn't work ... maybe its my phone but that just opens up the Chrome browser and stops on that home page when onclick is triggered
21st Apr 2017, 9:14 AM
AdamWhiz
AdamWhiz - avatar
0
I'm not trying to submit anything, I'm just trying to create an event to happen when the button is clicked, regardless of empty inputs. thanks though
22nd Apr 2017, 2:05 PM
AdamWhiz
AdamWhiz - avatar