कर्सर गुण कर्सर प्रकार को सेट करता है या लौटाता है जो कर्सर गुण के लिए प्रदर्शित किया जाएगा।
जावास्क्रिप्ट कर्सर संपत्ति को लागू करने के लिए कोड निम्नलिखित है -
उदाहरण
<!DOCTYPE html>
<html>
<head>
<style>
body {
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}
</style>
</head>
<body>
<h1>JavaScript Cursor property</h1>
<p class="sample"></p>
<h3>
Hover the mouse over the above paragraph after clicking the below button
</h3>
<button class="Btn">Change Cursor</button>
<script>
let sampleEle = document.querySelector(".sample");
document.querySelector(".Btn").addEventListener("click", () => {
sampleEle.style.cursor = "crosshair";
});
</script>
</body>
</html> आउटपुट

"कर्सर बदलें" बटन पर क्लिक करने पर -
