简体   繁体   中英

how to remove underline for anchor link in jquery

i have anchor tag in jquery as

success: function(result) {
   $('#MyGrid tbody').append('<tr><td><a STYLE="text-decoration:none" href="#"><font color=black><strong>' + result.name+ '</font></a></td></tr>');

to remove the underline i have added style property ,but it is not removing the underline.How can i remove the underline for anchor tag?

thanks, michaled

如果其他任何样式规则都覆盖了重要的内联样式,请尝试使用“重要”。

$('#MyGrid tbody').append('<tr><td><a style="text-decoration:none !important;" href="#"><font color=black><strong>' + result.name+ '</font></a></td></tr>');

Try properly closing your anchor, font, and strong tags:

success: function(result) {
    $('#MyGrid tbody').append('<tr><td><a STYLE="text-decoration:none"><font color="black"><strong>' + result.FileName + '</strong></font></a></td><td><a href="#" class="remove">Remove</a></td></tr>');
}

you forgot to close the anchor tag near to the font tag

try this i am not sure it's correct or not

$('#MyGrid tbody').append('<tr><td><a STYLE="text-decoration:none"><font color=black><strong>' + result.FileName + '</a></td><td><a href="#" class="remove">Remove</a></td></tr>');

or try this

$('#MyGrid tbody').append('<tr><td><a><font color=black><strong>' + result.FileName + '</a></td><td><a href="#" class="remove">Remove</a></td></tr>');
$('#MyGrid tbody tr td a').css("text-decoration","none");

You can try something like this:

<a href="#" style="text-decoration : none">HTML Hyperlink without Underline using inline style</a>

This worked for me.

Or else you can try with CSS style:

<html> <head> 
<title>HTML Hyperlink No Underline</title> 
<style type="text/css"> 
a {font-family : Arial; Font-size : 12px; text-decoration : none} 
a:link {color : #ff0000} 
a:visited {color : #00ff00} 
a:active {color : #666666} 
a:hover {color : #0000ff} 
</style> 
</head>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM