i would like to be able to replace my div within each other but it s not working cant figure out why
here is a the jsfiddle DEMO
replace div with simple jquery
Page 1 of 15 Replies - 641 Views - Last Post: 28 December 2014 - 08:21 AM
Replies To: replace div with simple jquery
#2
Re: replace div with simple jquery
Posted 28 December 2014 - 01:06 AM
Your demo doesn't have jquery attached at all.
#3
Re: replace div with simple jquery
Posted 28 December 2014 - 01:10 AM
Few things... in the fiddle you have to make sure to specify jQuery as a library you are using. Secondly, you had your id=4 INSIDE the string for the class. Third with replaceWith you have to make sure you select the element that you are going to replace with. Lastly, you have to make sure the page loads fully before running code so you should wrap your code inside a document.ready event (or self executing function).
I have made these corrections and saved it as a fiddle...
http://jsfiddle.net/aeyg89rd/2/
Hope you get what I am saying.
I have made these corrections and saved it as a fiddle...
http://jsfiddle.net/aeyg89rd/2/
Hope you get what I am saying.
#4
Re: replace div with simple jquery
Posted 28 December 2014 - 01:36 AM
I Don't use JQuery but I dont think it will let you have two elements with the same id.
#5
Re: replace div with simple jquery
Posted 28 December 2014 - 07:04 AM
Thanks , exactly what i was looking for
#6
Re: replace div with simple jquery
Posted 28 December 2014 - 08:21 AM
I don't know why you down reped Laytonsdad, he made a valid statement. You can't use jQuery if the library isn't specified.
Page 1 of 1

New Topic/Question
Reply


MultiQuote






|