JavaScript Creating Add to Favorites Button เป็นตัวอย่างการ JavaScript เพื่อสร้างปุ่ม Book Mark หรือ Add to Favorites
addFavorites.html
<html>
<head>
<title>ThaiCreate.Com Tutorial</title>
</head>
<body>
<form name="frmMain" action="" method="post">
<script language="JavaScript">
function addFavorites()
{
if (document.all)
{
window.external.AddFavorite
("https://www.thaicreate.com","ThaiCreate.Com Web Development Community In Thailand")
}
}
</script>
Welcome to www.ThaiCreate.Com Welcome to www.ThaiCreate.Com <br>
Welcome to www.ThaiCreate.Com Welcome to www.ThaiCreate.Com <br>
Welcome to www.ThaiCreate.Com Welcome to www.ThaiCreate.Com <br>
Welcome to www.ThaiCreate.Com Welcome to www.ThaiCreate.Com <br>
Welcome to www.ThaiCreate.Com Welcome to www.ThaiCreate.Com <br>
Welcome to www.ThaiCreate.Com Welcome to www.ThaiCreate.Com <br>
<br>
<a href="javascript:addFavorites();">Add Favorites</a>
</form>
</body>
</html>