jquery using this keyword | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

jquery using this keyword

I have create two div how to called one div two another **with jquery using this keyword** ex: o/p will be i will click 1 to display solo i will click 2 to display learn i will click 3 to display code <div> <div> <a href="">1</a> <a href="">2</a> <a href="">3</a> </div> <div> <div>solo</div> <div>learn</div> <div> code</div> </div> </div>

11th Mar 2017, 4:24 AM
Durgesh
Durgesh - avatar
3 Respuestas
+ 1
Why do you want to use "this" to do what your saying? Click on link to show the correct div. Give the divs id's <div id="first "> and then the links cab reference that div to show.
11th Mar 2017, 11:14 PM
Stuart Robb
Stuart Robb - avatar
0
yeh i know that but using this keyword that code become small size...and smart work.. i think it is not possibel.. and thanq to resp
16th Mar 2017, 2:56 PM
Durgesh
Durgesh - avatar
0
You can always add an id to the outer div of solo/learn/code. Then use jquery like $("div", "#containerId").each(function () { $(this) }); Something along these lines will then loop through all three of those divs and this will be updated each time
16th Mar 2017, 3:01 PM
Stuart Robb
Stuart Robb - avatar