Reputation: 155
There are a lot of buttons in my HTML. And each time when I click on one button, that button is activated (other buttons are deactivated). And I want that, letters can be directly typed onto that specific button like a textbox (type="text"). Is that possible with javascript? Or do I need other things like JQuery, etc?? Thanks!
Upvotes: 1
Views: 79
Reputation: 2115
You can wrap an input tag around a button tag and style it with CSS so that it merges with your button.
Upvotes: 0
Reputation: 8380
One way is to add an input
element inside a button
element.
For example:
<button>
<input type="text" placeholder="type somthing here" />
Send
</button>
See the working version: https://jsbin.com/lomufaqoxe/edit?html,output
Upvotes: 2
Reputation: 11661
Something like this?
<button contenteditable="true">Foobar</button>
Upvotes: 4