How do I specify a second condition that requires that the user not only click a link but click in the area between a div in order to go to landing.html?
<script src="http://code.jquery.com/jquery-1.5.1.min.js"></script>
<script language="JavaScript" type="text/javascript">
$(document).ready(function () {
$("#postos").click(function() {
$("#linkos").attr('href', 'landing.html');
});
$('#clickdiv div').click(function () {
$("#linkos").attr('href', 'landing.html');
});
});
</script>
<a id="postos" href="#"></a>
<div id="clickdiv">please click</div>
<a id="linkos" href='javascript:window.alert("click the link and div");'><br/><img src="pic.png"></a>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…