jQuery – a Simple Example With Two Links
Today I have started to take a better look at JQuery. And it seems wonderful! Indeed. Full of wonders 🙂
Thus, I have started to code something trivial – like the picture below:
With JQuery, this click option of the text (this is not a link), is just one liner. With JS it would have been one line as well, but with some more words. Anyhow, the code:
<!DOCTYPE HTML>
<html>
<head>
<title>VitoshAcademy.Com</title>
<script src="jquery-1.10.1.min.js" type="text/javascript">
</script>
<script>
$(document).ready(function()
{
$("#idText").click(function()
{
$("#idDiv").html("<b><a href=http://www.herecomesthecode.com>herecomesthecode.com</a></b>");
});
});
</script>
</head>
<body>
<div id="idDiv">
<p>vitoshacademy.com</p>
<a id="idText" href="#">Click Me</a>
</div>
</body>
</html>
At this moment I usually say “Enjoy it”, but this time I would just keep quiet 🙂
