I'm struggling to accomplish a seemingly simple task of rotating this chevron 180 degrees on click. The Rich Text Editor converts <i>
tags to <em>
, and we are using an outdated jQuery version (1.12.4). Despite trying multiple scripts, I have not been successful so far. Can anyone spot what I might be overlooking?
$(document).ready(function() {
$('#view-more-cards').click(function() {
$('.smb-chevron-container > a > em > svg').css('transform', 'rotate(180deg)');
});
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<div class="container">
<div class="smb-chevron-container" id="view-more-cards">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" data-target="#view-more">View all internet solutions
<em>
<svg xmlns="http://www.w3.org/2000/svg" id="view-more-chevron" width="14.223" height="7.111" viewbox="0 0 14.223 7.111">
<g id="Ren_Icons_Controls_add-maximize" data-name="Ren/Icons/Controls/add-maximize">
<path id="smb-chevron" d="M7.111,7.111a.789.789,0,0,1-.535-.2L.219,1.158A.634.634,0,0,1,.219.2a.806.806,0,0,1,1.06,0l5.832,5.28L12.943.2A.806.806,0,0,1,14,.2a.634.634,0,0,1,0,.959L7.646,6.912a.789.789,0,0,1-.535.2Z" fill="#0057b8"></path>
</g>
</svg>
</em>
</a>
</div>
</div>
<div class="collapse" id="view-more">
Hello World
</div>