0

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"} });

1 Answer 1

1

use html instead of value

var somebutton = $("<button/>", { type: "button", html: "Save" });
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.