I have a HTML unsorted list which I capture its “on click” event. When a list item is clicked on I want to change that items font setting to bold so that the user gets a visual indicator that it’s been selected. Is this possible?
相关问题
- Views base64 encoded blob in HTML with PHP
- Is there a way to play audio on a mobile browser w
- HTML form is not sending $_POST values
- implementing html5 drag and drop photos with knock
-
Why does the box-shadow property not apply to a
<li onclick="this.style.fontWeight= 'bold'">
Or do you want to change it back to regular when another li is clicked? I think you should use jQuery then (it's possible in regular javascript but this is just so much easier)
Or even easier, just add a class:
CSS:
.selected { font-weight: bold }
jQuery: