I need help with a form that has an <input type="submit"
element where the value is set dynamically based on currIntValue
.
My goal is to change the displayed value to 'Search' when hovering over the input, instead of showing currIntValue
.
I attempted to use two different inputs and toggle their visibility on hover, but this approach is not working as expected. The className="int-val"
element hides and reappears repeatedly when hovered over.
Below is a simplified version of my implementation:
.int-val {
display: inline;
}
.int-val:hover {
display: none;
}
.search-val {
display: none;
}
.search-val:hover {
display: inline;
}
<input type="submit" value={currIntValue} className="int-val"/>
<input type="submit" value='Search' className="search-val"/>
If there's a CSS-only solution to achieve this effect, please point out where I might be making a mistake.
Thank you for your help in advance!