这里运行的功能是我到目前为止有:当获取点击一个链接
<html>
<head>
<title>Major League Baseball</title>
</head>
<body>
<script type="text/javascript" language="JavaScript">
document.writeln("2013 World Series");
var today= new Date()
$(document).ready(function() {
});
function changeLang(lang) {
document.cookie = 'myCulture=' + lang;
window.location.reload();
return false;
}
link1.onclick = function(e) { return myHandler(e); };
</SCRIPT>
<BODY onload=alert(today)>
<a id="link1" href="http://boston.redsox.mlb.com/index.jsp?c_id=bos&sv=1">Red Sox homepage</a>
<body onload="onload();">
<input type="text" name="enter" class="enter" value="" id="lolz"/>
<input type="button" value="click" onclick="kk();"/>
</body>
</html>
我想点击一个链接时添加一个JavaScript函数。我希望链接在新窗口中打开。这会被视为一种功能吗?
这个链接怎么样? http://www.w3schools.com/jsref/event_onclick.asp – Rawa
你看过[target =“_ blank”](http://www.w3schools.com/tags/att_a_target.asp)吗?它可能更简单,取决于你想要做什么 –
这应该工作。你会认为这是一个JavaScript功能? – user2916725