add this alert(document.getElementById("tabTwo"))
next to the alert("got it");
and check if it can find your tabTwo
element.
1- I think the problem might be the tabTwo
is not your tab's ID.
or
2- your tab is being loaded after when window.onload
happens. which is probably because your tabs is being created based on some Ajax
requests and you have to wait until it is done.