I am trying to change the attribute of a span. jquery does not change the value but javascript does. What can be the problem? Is there any disadvantage of using javascript?
My code is as follows:
$('#ctl00_c_ActivityContainer_ctl00_ctl01_tmmQuestionZone_0').attr('draggable', 'false');
document.getElementById("ctl00_c_ActivityContainer_ctl00_ctl01_tmmQuestionZone_0").setAttribute("draggable", "false");
<span id="ctl00_c_ActivityContainer_ctl00_ctl01_tmmQuestionZone_0" draggable="true">
</span>
use prop method ( assumes jQuery >=1.6)
Also you were using a string for “false’