admin管理员组

文章数量:1304149

There is a tooltip when my mouse is over the textbox : "please fill out this field" is there a way too change this text ?

if you hover on this field you can see the massage :

<input type="text" name="yourname" required/>

There is a tooltip when my mouse is over the textbox : "please fill out this field" is there a way too change this text ?

if you hover on this field you can see the massage :

<input type="text" name="yourname" required/>

Share Improve this question asked Feb 12, 2020 at 15:14 inazinaz 1,7855 gold badges22 silver badges43 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 5

This could be easily done using the title HTML attribute.

title Attribute

The title attribute belongs to the Global Attribute. It allows to specify extra information about an element. This information is shown as a tooptip text when the mouse moves over the element.

<input type="text" name="yourname" required title="You changed it !!"/>


If its something related to the text showed after validation. For that you could use the function setCustomValidity along with an event Handler . Here we would use the event Handler oninvalid.

Your code could be written as :

<input type="text" name="yourname" required oninvalid="this.setCustomValidity('Yo! You changed it')" oniput="this.setCustomValidity('Yo! You changed it')" title="test"/>

you can add a title on your input

<input title="test" type="text" name="yourname" required/>

本文标签: javascripthow to change default input tooltip text that shows in required inputStack Overflow