rivkamak
asked on
simple jquery issue
I have a button on a div on my site.
When you click button A, then button B becomes visible by changing the class.
Then when button B has that new class if you click on it, something will happen. right now i'm trying to just log a console .
I don't know what I did wrong on the script. I am not getting an error, but no console log either.
I do see the button B has the correct class changed to it.
i tried also doing it with an id.
either one isn't logging anything.
what might be wrong?
When you click button A, then button B becomes visible by changing the class.
Then when button B has that new class if you click on it, something will happen. right now i'm trying to just log a console .
I don't know what I did wrong on the script. I am not getting an error, but no console log either.
I do see the button B has the correct class changed to it.
i tried also doing it with an id.
either one isn't logging anything.
what might be wrong?
$(".pledgeBut").click(function(){
$(".thumbbuttonoff").removeClass('thumbbuttonoff').addClass('thumbbuttonon').attr('id', 'buttonon');
});
$(".thumbbuttonon").click(function () {
console.log('button on');
$("#phonescreen1").toggle();
$("#phonescreen2").toggle();
});
$("#buttonon").click(function() {
console.log("try two");
});
Post the code for the buttons.
ASKER
I posted my code on top . you can see on the top of this page:
http://www.kars4kids.org/texting/index2.asp
Right now the document.on isn't working. it's telling me not a valid function.
http://www.kars4kids.org/texting/index2.asp
Right now the document.on isn't working. it's telling me not a valid function.
Don't know what we're supposed to be clicking but leakim is probably right anyway.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
But why would that happen.
at the time of the click my new id will work.
it's just not there at the time of document.load
How do people do these fancy animations? things happen later as id's and classes change
at the time of the click my new id will work.
it's just not there at the time of document.load
How do people do these fancy animations? things happen later as id's and classes change
Did you tried my last suggestion ID: 39263895?
For example $("#notYetInThePage").clic
will not work
when : $(document).on("click", ".CheckIf_ImPresentInThePa
will work
Open in new window