Powered by Blogger.

Effective role of anchor tag in html

 


  •  How can I set multiple recipients in a "mailto:" link in HTML?
                           Below are the code for ways of assigning one or more recipients from a mailto: link. 

<A href="mailto:person1@domain.dom, person2@domain.dom, ..., personN@domain.dom?subject=Mail_Subject&body=Body_Content">tell a friend</A>

                            Here in the above code we can also specified the subject & Body_Content of mail but this is optional.
------------------------------------------------------------------------
  • Download Attribute
                            We can also download the file from server & assigned the name as test.pdf during the downlaoding by using (download="test.pdf") assign in <a> tag as shown below..
<!-- will download as "test.pdf" -->
<a href="/files/abc.pdf" download="test.pdf">Download Your Expense Report</a>
------------------------------------------------------------------------
  • If you link to something like to open a file
<a href="file:///D:/yourfile.pdf">yourfile.pdf</a>

                           The above specifies a path to a file called D:/yourfile.pdf on the D: drive on the machine on which you are viewing the URL. So user can able to see the pdf file.
------------------------------------------------------------------------
  • HTML back link
<script>
    document.write('<a href="' + document.referrer + '">Go Back</a>');
</script>

                             This is the back link script that are used to take a visitor to a previous open page link.
--------------------------------------------------------------------------------------------------------
  • Givinig a call link
                              By using below code we can able to make a call to the given number on website
<!-- Embedded within normal page text -->
<p>If you would like to talk, <a href="tel:5555555">Call Me!</a></p>

<!-- Linking a custom image -->
<a href="tel://555-5555"><img src="phone.png" alt="Call Now!" /></a>

<!-- Cross-platform compatible (Android + iPhone) -->
<a href="tel://1-555-555-5555">+1 (555) 555-5555</a>
------------------------------------------------------------------------
  • Need a pop-up window
                             To open a small pop window then you can also used below code.
 <a href="#" target="popup" onclick="window.open('file_name.html','name','width=600,height=400')">Open page in new window</a>
------------------------------------------------------------------------
  • Reload
                             By using below code we can able to reload our page.
<a href="#" onclick="window.location.reload(true);">1</a>

No comments