$(document).ready(function(){ $(".job_link").click(function(){ $(this).parents(".job_item").find(".job_desc").toggleClass("job_hidden"); $(".arrow span").text(↓); }); }); I want the contents of the span to change when they are clicked, by default it is there нужно And it’s necessary that when they are clicked, they change to ↓ when they click again to
How to do this? Now this code is not working, because .arrow span does not understand for which class for some reason.
Added markup:
<div class="job_item"> <div class="job_title"> <a class="job_link" href="javascript:void(0);"> <b><?=$name?> </b></a> <span class="arrow" style="cursor: pointer; color:#911B1D;">↑</span> </div> <div class='job_desc job_hidden'> <p> <?=$text?> </p> </div> </div>
.arrow span- not quite right for a particular case, here you need to writespan.arrow:-) - chernomyrdin