+ 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
9 Answers
+ 26
onload=function(){document.getElementById("submit").innerHTML="yolk";};
+ 25
onload=function(){
document.getElementById("submit").onClick = function() {
document.getElementById("submit").innerHTML = "yolk";
}};
+ 12
window.onload = function() {
document.getElementById("submit").innerHTML = "yolk";
}
+ 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)
+ 4
onsubmit="somefunc(); return false;"
didn't mean to hijack this thread
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! :)
0
so all javascript needs to be inside an onload event??
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
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