这是我在 UI 中的内容-
View by Team <dropdown list> (OR) Click on image to navigate
当从下拉列表中选择一个特定的团队时,UI 会像这样显示 -
View by Team <dropdown list>
Home
当我点击主页时,我希望 UI 是 -
View by Team <dropdown list> (OR) Click on image to navigate
但我得到的 UI 是 -
View by Team <dropdown list>
(OR) Click on image to navigate
在源代码中,我有——
<div id="teamList"><select><options></select>
<span id="text">(OR) Click on image to navigate</span>
</div>
在用于从下拉列表中选择团队的 javascript 函数中,我指定了 -
document.getElementById('text').style.display='none';
如何防止出现额外的换行符?
最佳答案
尝试像这样在另一个时间段内给家
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-2.1.0.js"></script>
<script type="text/javascript">
$(function(){
document.getElementById('text').style.display='none';
});
</script>
</head>
<body>
<div id="teamList"><select><options></select>
<span id="text">(OR) Click on image to navigate</span>
<span>Home</span>
</div>
</body>
</html>
这是 fiddle http://jsfiddle.net/BnFpJ/
关于javascript - 避免在单击链接时插入换行符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21571110/