জাভাস্ক্রিপ্ট ৷ document.href প্রদান করেছে এবং document.target একটি লিঙ্কে href এবং লক্ষ্য বৈশিষ্ট্যগুলি পেতে। একটি লিঙ্ক সাধারণত
href অ্যাট্রিবিউট খোঁজা৷
href অ্যাট্রিবিউট পেতে, document.href অবশ্যই ব্যবহার করতে হবে. নিম্নলিখিত উদাহরণে, href অ্যাট্রিবিউটে "http://www.tutorialspoint.com/" নামে একটি লিঙ্ক থাকে, যেটি প্রোগ্রামটি কার্যকর হওয়ার পরে প্রদর্শিত হবে৷
উদাহরণ
<html>
<body>
<p><a id="myId" href="http://www.tutorialspoint.com/">tutorialspoint</a></p>
<script>
var ref = document.getElementById("myId").href;
document.write(ref);
</script>
</body>
</html> আউটপুট
tutorialspoint http://www.tutorialspoint.com/
টার্গেট অ্যাট্রিবিউট খোঁজা
লক্ষ্য পেতে বৈশিষ্ট্য, document.target অবশ্যই ব্যবহার করতে হবে. নিম্নলিখিত উদাহরণে, টার্গেট অ্যাট্রিবিউট "_union " প্রোগ্রামটি সম্পাদিত হওয়ার সময় প্রদর্শিত হয়েছিল৷
৷উদাহরণ
<html>
<body>
<p><a id="myId" target="_union" href="http://www.tutorialspoint.com/">tutorialspoint</a></p>
<script>
var ref = document.getElementById("myId").target;
document.write(ref);
</script>
</body>
</html> আউটপুট
tutorialspoint _union