Yesterday I have put the question which was answered correctly but now I want to convert that same code into javascript. I have made some changes but its not work
working code- http://jsfiddle.net/SXzyR/8/
mycode- http://jsfiddle.net/SXzyR/11/
Yesterday I have put the question which was answered correctly but now I want to convert that same code into javascript. I have made some changes but its not work working code- http://jsfiddle.net/SXzyR/8/ mycode- http://jsfiddle.net/SXzyR/11/ |
|||||||||
closed as off topic by Rory McCrossan, hjpotter92, Jamiec, M42, wich Oct 18 '12 at 10:15Questions on Stack Overflow are expected to relate to programming within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question. |
|||||||||
|
You want to use |
|||||||||
|
Please read some tutorials about jQuery. This is a good start, also have a look here. jQuery isn't another language, it's a library for JavaScript. Considering the following line from your "translated" code:
Instead of writing document.getElementById you can simply use jQuery to write
as in the first example (working code). Also you are mixing jQuery with "native" JavaScript/DOM functions in your code. Don't reinvent the wheel, use jQuery to accomplish your task. |
|||||||||
|