+ 5
innerHtml isn't working for me
I'm trying to use innerHTML to change content to another is but when I click the tabs buttons I've set, nothing happens and the text stays the same https://code.sololearn.com/WPMNdUMnUJ0y/?ref=app
12 Respostas
+ 3
Mike Choy Will this help me get my Website "Vulnerabilities" and "Program Exploits" buttons to work?
+ 2
Mike Choy I don't think the code I used for my "next" button affects my problem with my nav buttons not working.
+ 2
Mike Choy But for some reason the next button doesn't work anymore. It was fine yesterday.
+ 2
Okay. You say, take the declaring elements outside of the window onload? I'll try. And I really hope the next button still works because it just stopped working for me.
+ 2
Mike Choy I made a smaller version of the thing I'm trying to do and not even the test subject is working. When I click the websec button nothing changes. 😓
+ 2
I'm just getting super frustrated
+ 2
Thanks. I will look over it. While you were doing I remade the site with the buttons working but for some reason it tells me my next button doesn't have a function but it does.
+ 1
Your Next button works for me.
Have a crack at fixing the navs, if you get stuck I am happy to help you
0
Hi CK
You have declared all of your variables inside the window.onload function.
This means that once window .onload has executed those variables get garbage collected.
eg var intro=document.getElementById("intro")
var SQL=document.getElementById("SQL");
var XSS=document.getElementById("Xss");
var BA=document.getElementById("BA");
var next=document.getElementById("next");
You need to move them into the global scope but set them inside window.onload
=================like this=====================
var intro,
SQL,
XSS,
BA,
next;
window.onload=function(){
//tabs
intro=document.getElementById("intro")
SQL=document.getElementById("SQL");
XSS=document.getElementById("Xss");
BA=document.getElementById("BA");
next=document.getElementById("next");
...........
}
Also declare your onClick handlers outside of windows.onload as well
have a crack and see how you get on
0
Give me moment and I will fix for you. There is no need to us java script for the links at the moment. Also you have multiple ids with the same names in your HMTL.
0
Hi CB
Here is working site for you , with no JavaScript!!
https://code.sololearn.com/WAb3ZN30bYik/#html
If you would like to see a JavaScript version I can do this also...... but may take some time.
Good luck on adding your own content, I hope it is self explanatory
0
OK good luck