Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

HTML | DOM onselect Event

  • Last Updated : 27 Jul, 2021

The onselect event in HTML DOM occurs when user selects some text in an element. This event is mostly used in <textarea> and <input> tag.
Supported Tags:

  • <input type=”file”>

Syntax: 
 

Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.

  • In HTML: 
     
<element onselect="Script">
  • In JavaScript: 
     
object.onselect = function(){Script};
  • In JavaScript, using the addEventListener() method: 
     
object.addEventListener("select", Script);
  • Google Chrome
  • Internet Explorer
  • Firefox
  • Apple Safari
  • Opera
My Personal Notes arrow_drop_up
Recommended Articles
Page :