I'm a beginner in CSS and JavaScript, and I've been attempting to change the text appearance from bold to normal when a checkbox is clicked, but so far, I haven't been successful... Initially, the text includes some bold words, but after clicking it, the entire phrase should switch to font-weight: normal...
<FORM>
<input type="checkbox" name="adresa1 onClick="GetBold(this);" id="mail1"> <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="fb9a9f899e889abb9e838b9e9f928f9489d5989496">[email protected]</a> - <B>Subiectbold daca email necitit</B> - data primire <BR>
<input type="checkbox" name="adresa" > <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b3d9dcd6caf3d4ded2dadf9dd0dcde">[email protected]</a> - <B>Subiectbold daca email necitit</B> - data primire </a><BR>
<input type="checkbox" name="adresa" > <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b3d2d7c1d6c0d2f3d6cbc3d6d7dac7dcc19dd0dcde">[email protected]</a> - <B>Subiectbold daca email necitit</B> - data primire <BR>
</FORM>
and although I have implemented the given function below, unfortunately, it's not functioning as intended:
<script>
function GetBold(current)
{
var array = document.getElementById("mail1");
for (var i = 0; i < array.length; i++)
{
array[i].style.fontWeight = 'normal';
}
current.style.fontWeight = 'bold';
}
</script>