SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast rexoids's Avatar
    Join Date
    May 2004
    Location
    Sydney
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Mailto: function with class... do-able??

    Hi there,

    I found this code:

    <script language="JavaScript">
    <!--

    document.write ("<a href='mailto:?subject=Divine gift wrapping made easy!&body=%20"+location.href+"'>Here</a>")

    // -->

    </script>

    Just wondering if it's possible to add class="bot" to the link to keep my formatting consistant... I've tried it all over the place, but no joy

    Many thanks!

  2. #2
    SitePoint Member
    Join Date
    May 2007
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You either need to escape your double quotes or use single quotes.

    Escaping: class=\"bot\"
    or
    Single: class='bot'

    Code:
    <script language="JavaScript">
    <!--
    
    document.write ("<a class='bot' href='mailto:?subject=Divine gift wrapping made easy!&body=%20"+location.href+"'>Here</a>")
    
    // -->
    
    </script>


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •