Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3788694
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T12:02:23+00:00 2026-05-19T12:02:23+00:00

This is the html: <button>Static</button> <form> <span id=test> </span> </form> This is the jQuery

  • 0

This is the html:

<button>Static</button>
<form>
<span id="test"> </span>
</form>

This is the jQuery – runs in the document.ready:

    $('#test').append('<button>Dynamic</button>');

    $('button').live('click', function(){
       alert($(this).attr('type')); 
    });

    //even this one:
    alert($('<button>test</button>').attr('type'));

The it alerts it says the ‘type’ is ‘submit’, but I haven’t specified a type. How come? At least IE and Chrome are consequent in giving it the type “submit”. But I don’t even have a form, so it seems weird to make it a submit-button.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T12:02:24+00:00Added an answer on May 19, 2026 at 12:02 pm

    The default value for the type attribute for <button> elements is defined as ‘submit’ in the specification.

    submit: Creates a submit button. This is the default value.

    http://www.w3.org/TR/html4/interact/forms.html#h-17.5

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have jquery code like this: html += '<div class=index>' + item.index +
I have an html button which is really just this: <div onClick=window.location.href=somePage.htm> <img src=img.png/>
I have this HTML which looks like this: <input type=submit name=savebutton class=first button />
I'm trying to create a button with icon like this : HTML: <div id='button'>
I want to do something quite simple. Click a button on my html javascript
i want to trigger an applet button on click of a normal html button
Given this HTML: <ul id=topnav> <li id=topnav_galleries><a href=#>Galleries</a></li> <li id=topnav_information><a href=#>Information</a></li> </ul> And this
Given this HTML: <div>foo</div><div>bar</div><div>baz</div> How do you make them display inline like this: foo
Given this HTML snippet: <div id=box style=overflow:auto; width:200px; height:200px; border:1px solid black;> 1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>10<br> 11<br>12<br>13<br>14<br>15<br>16<br>17<br>18<br>19<br>20<br>
I have this HTML structure and want to convert it to an accordion. <div

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.