How to change the 'text-decoration' property with jQuery?

To change text decoration property with jQuery, use the jQuery css() property.


You can try to run the following code to change text-decoration property from underline to overline:

Live Demo

<!DOCTYPE html>
<script src=""></script>
        mouseenter: function(){
        $(this).css({"text-decoration": "overline"});
p {
   text-decoration: underline;
<p>Move the mouse pointer on the text to remove underline and add overline.</p>