-1

如何通过避免在 JavaScript 中更改为蓝色字体来隐藏超链接下划线并保持原点。我的 JavaScript 代码:

<a href="javascript:window.open('selectprofiletype.php','Crm.com - Create',
'width=700,height=350' ) ">&nbsp;&nbsp;User Profile</a>
4

4 回答 4

4

为什么是 JavaScript?使用 CSS。

a {
  text-decoration: none;
  color: black;
}
于 2012-11-22T14:41:03.537 回答
3

希望这可以帮助:

a {
    color: #0060B6;
    text-decoration: none;
}

a:hover 
{
     text-decoration:none; 
     color: #0060B6;
     cursor:pointer;  
}
于 2012-11-22T14:41:14.913 回答
1

请将 JavaScript 更改为以下内容(并使用 CSS 的任何其他答案,而不是使用内联样式)

<a href="selectprofiletype.php" target="crm_create" style="text-decoration:none"
onclick="var w = window.open(this.href,this.target,'width=700,height=350');
  return w?false:true;">&nbsp;&nbsp;User Profile</a>

因为您的代码会在多个浏览器中出现问题 - 例如窗口名称可能没有空格

如果不显眼,代码会更好:

window.onload=function() {
 document.getElementById("crm").onclick=function() {
  var w = window.open(this.href,this.target,'width=700,height=350');
  return w?false:true;
 }
}

只使用

<a id="crm" href="selectprofiletype.php" target="crm_create">User Profile</a>
于 2012-11-22T14:57:07.593 回答
1

这似乎更像是一个css问题

a{
text-decoration: none; 
color: your colour here;
}
于 2012-11-22T14:41:29.423 回答