答案 0 :(得分:0)
Icon有id,所以给id输入并使用jQuery代码。
$(document).ready(function(){
$('#simple').click(function(){
window.onload = window.location.href = "http://stackoverflow.com";
});
});
$(document).ready(function(){
$('#basic-addo1').click(function(){
window.onload = window.location.href = "http://stackoverflow.com";
});
});
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">@</span>
<input type="text" class="form-control" placeholder="Username" aria-describedby="basic-addon1" id="simple">
</div>