Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
<div id="user_info"></div>
<script type="text/javascript">
$(function(){
$('#user_info').click(function(){
alert("clicked on user info");
});
});
</script>
<script type="text/javascript src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js"></script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
$('body').click(function(event){
if($(event.target).attr('id') == 'user_info'){
alert("clicked inside user_info");
}else{
alert("clicked outside user_info");
}
});
});
</script>
</head>
<body>
<div id="user_info" style="width: 400px; height: 200px; border: solid 1px red; background-color: lightyellow;"></div>
</body>
</html>