Monday, May 13, 2024
 Popular · Latest · Hot · Upcoming
-3
rated 0 times [  4] [ 7]  / answers: 1 / hits: 34780  / 11 Years ago, fri, april 26, 2013, 12:00:00

How to change the type attribute from submit to button using JavaScript or jQuery? I use an input
element like <input type=submit name=submitform/>.


More From » jquery

 Answers
58

Change the property of the native DOM node:



document.getElementsByName(submitform)[0].type = button;


Do it with jQuery:



$(input[name='submitform']).prop(type, button);


But remember that you cannot change input types in Internet Explorer 8 and below.


[#78608] Thursday, April 25, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
clarkulisesa

Total Points: 422
Total Questions: 93
Total Answers: 112

Location: Austria
Member since Thu, Jan 7, 2021
3 Years ago
clarkulisesa questions
Mon, Feb 24, 20, 00:00, 4 Years ago
Mon, Aug 12, 19, 00:00, 5 Years ago
;