ওভারভিউ
Link type প্রপার্টি লিংক করা ডকুমেন্টের টাইপ সেট/রিটার্ন করে।
সিনট্যাক্স
type অ্যাট্রিবিউটের মান রিটার্ন করা
linkObject.type
type সেট করা
linkObject.type = value
নোট: বৈধ মানগুলো হলো "text/javascript", "text/css", "image/gif" ইত্যাদি।
উদাহরণ
Link type প্রপার্টির উদাহরণ:
<!DOCTYPE html> <html> <head> <title>Link type</title> <link id="extStyle" rel="stylesheet" href="style.css" type="myStyle"> </head> <body> <form> <fieldset> <legend>Link-type</legend> <input type="button" value="Correct Type" onclick="correctType()"> <div id="divDisplay"></div> </fieldset> </form> <script> var divDisplay = document.getElementById("divDisplay"); var extStyle = document.getElementById("extStyle"); divDisplay.textContent = 'The linked document type: '+extStyle.type+' is not compatible'; function correctType(){ extStyle.type = 'text/css'; divDisplay.textContent = 'Congrats! The linked document type: '+extStyle.type+' is compatible'; } </script> </body> </html>
উপরের উদাহরণে 'style.css' নিচের কন্টেন্ট ধারণ করে:
form { width:70%; margin: 0 auto; text-align: center; } * { padding: 2px; margin:5px; } input[type="button"] { border-radius: 10px; }
আউটপুট
'Correct Type' বাটনে ক্লিক করার আগে:

'Correct Type' বাটনে ক্লিক করার পর:
