How to Create a Button in Web –in HTML

    0
    84
    Spread the love
    • 1
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
      1
      Share

    Button is an important aspect of website.Rather in client side button is the heart of webpage. Basically it triggers any action. it is very important to learn the functionality of button.So a button is a graphical representation of trigger point of an HTML page.

    This article is mainly for automation test engineers who work on button object.

    Let us understand how the developers create a button.

    <input type=”button”/>

    Well this is enough to create a button. This is how the button will look like.

    let us do little more.. let us give it a name..I am creating a button with a name “button1” and display for user will be Click me.

    <html>
     <head>
     <title> Testing button </title>
      </head>
     <body>
     <form name=”form1″>
     <input type=”button” name=”button1″ value=”Click me”/>
    </form>
    </body>
    </html>

    The output will be..

    Let us understand the argument and properties of a button

    Type Item
    Details
    Arguments String What shall appear on top of the button
    num This is bit interesting.When there are multiple button with same name then this number becomes handy.Remember descriptive programming , we use index a property to uniquely identify an element.  
    Properties form This property is required when form object of the button needs to be passed
    name mandate property to uniquely identify a button.it specifies the name attribute
    type This is required to create a button and specific input to <input> tag. This is always button for button class
    value This is the string which is seen when a webpage runs
    id This is to set an id for a specific object for a web. We mainly use this feature when we filter a webpage by using getElementbyID

    image credit: http://www.dragonartz.net

    Don't miss out!
    Subscribe To Newsletter

    Receive top technical news, lesson ideas, travel tips and more!

    Invalid email address
    Give it a try. You can unsubscribe at any time.

    Spread the love
    • 1
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
      1
      Share

    LEAVE A REPLY

    Please enter your comment!
    Please enter your name here