Reputation: 1912
I am trying to switch the button from input
to button
in Javascript and I cant figure out how to put value in between the button
tag and the right syntax.How can I accomplish this ? Thanks
here is the input button that I have
var somebutton = $("<input/>", { type: "button", value: "Save" });
i'd like something like this, but its not a right syntax
var somebutton = $("<button/>", { type: "button", {"Save"} });
Upvotes: 0
Views: 40
Reputation: 207501
use html
instead of value
var somebutton = $("<button/>", { type: "button", html: "Save" });
Upvotes: 1