buttonI need to style the anchor tag to look like a rectangular tile (which I'm already doing) and when clicked on that tile/anchor tag, I need to do the following 2 things:
- Keep it selected and highlight it with Green colour.
- On selection or change in selection between TILE-1, TILE-2 and TILE-3, I need to fetch the value of the text in the input field.
Can someone please share any guidelines on how this can be done, please?
const showTile = (): ReactElement => {
<ul className="tileList">
<li>
<button href="#Tile1" class="tile" >
TILE-1
</button >
</li>
<li>
<button href="#Tile2" class="tile">
TILE-2
</button >
</li>
<li>
<button href="#Tile3" class="tile">
TILE-3
</button >
</li>
</ul>
};
const showTextBox = (): ReactElement => {
<input type="text" value="">
};
const [selectedTile, setSelectedTile] = useState("");
const [textVal, setTextVal] = useState("");
return (<div> {showTile} {showTextBox} </div>);
ul,
li {
list-style: none;
}
.tileList > li button {
color: grey;
background-colour: yellow;
border: 1px solid #ffffff;
padding: 10px 15px;
font-size: 13px;
}