Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Difference between Anchors, Button and Input

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 385
    Comment on it

    ANCHORS-

    Anchors represent hyperlinks. A hyperlink is used to navigate or if we want to move a user from one page to another or download a file or external resources.

    Anchors are also used to link to particular section of the same page by giving # and an id   attribute.

    If we want to provide information in some other window or popup, then we use link.

    E.g: A helping window (for instruction) is available on the screen, while we are filling up the form.

    Following are the examples of the locations that an anchor reference to:-

    •         link to another page
    •         particular section of the same page
    •         top of the current page

     

    Steps to add anchor links to a page:-
    1.First we will find where we have to put the anchor link in the page.
    2.Then we need to add anchor tag in the HTML, to create link.

    This is the format of using anchor tag-

    <a href=“#Nextpage” >Link</a>

     

    BUTTON-

    A Button is pressed or clicked to perform an action by the user. Buttons are the alternatives of 'input type button', which is much easier to style in HTML.

    Like an input button is also having type attribute. The type attribute can be set to submit, reset or button. The default type is submit.

    Button and input also support disabled attribute, but anchors are not having this property.

    Following are the events of the button control:-

    S.No. Event Description
     1. Click Arise when the control is clicked.
     2. DoubleClick Arise when the user double clicks the button control.
     3. GotFocus Arise when the control receives focus.
     4. TabIndexChanged Arise when the TabIndex property value changes.
     5. TextChanged Arise when the Text property value changes.
     6. Validated Arise when the control is finished validating.

     

    INPUT-

    The <input> tag determine an input field where user can enter the data. this tag is used inside the <form>.

    The <input> tag can be used in many ways, depending on the attribute.

    The type attribute tells the browser which typ of data is in the input control.

     

    1. <input type="submit">:- It's a button, which on clicks perform submit action.
    2. <input type="image">:- It takes an src attribute which displays an image.
    3. <input type="file">:- It is used to upload a file.
    4. <input type="reset">:- It is used to reset a form.
    5. <input type="button">:- It is a button having no default behavior. We can add functionality by JavaScript.
    6. <input type="text">:- enters normal text.
    7. <input type="radio">:- Define radio button, used to select one from many choices.

    .E.g of <input>-

    <form>
      First name:<br>
      <input type="text" name="firstname">
      <br>
      Last name:<br>
      <input type="text" name="lastname">
    </form>

     

     

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: