Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

HTML fun

Options
  • 06-05-2004 2:28pm
    #1
    Registered Users Posts: 6,240 ✭✭✭


    Hi I have a link like
    <a href="hj" onclick="return confirm(&quot;are you sure?&quot;);">hhhh</a>
    
    now when I press hhh a box will pop up to say

    are you sure?

    yes/no etc

    if I wanted to have the words
    Are you "Sure"?

    ie with the " included - how do I do this??
    I have tried " and this gives me a JS error
    I have tried \" and ditto

    any ideas??


Comments

  • Registered Users Posts: 68,317 ✭✭✭✭seamus


    try using ' to quote your string instead of "


  • Closed Accounts Posts: 1 moljunior


    change

    <a href="hj" onclick="return confirm("are you sure?";">hhhh</a>


    to

    <a href="hj" onclick="return confirm("are you sure?";">Are you "sure"?</a>

    worked for me


  • Registered Users Posts: 629 ✭✭✭str8_away


    You can use " inside of ' or ' inside of "

    So first thing is to change
    <a href="hj" onclick="return confirm("are you sure?");">hhhh</a>
    to
    <a href="hj" onclick='return confirm("are you sure?");'>hhhh</a>
    or
    <a href="hj" onclick="return confirm('are you sure?');">hhhh</a>

    but since you want to display are you "Sure"
    then you coule use the \" but this need to match the outer

    so your finnal code should be
    <a href="hj" onclick='return confirm("are you \"Sure\"?");'>hhhh</a>


    I hope this is clear :D


  • Registered Users Posts: 3,132 ✭✭✭oneweb


    You have th bracket and semicolons in the wrong places too. Why not use *SURE*?, it's punctuationally more correct (tho I'm not sure that word is grammatically correct :p)

    Try
    </head><body><a href="hj" onclick='confirm("are you \"sure?\"");'>hhhh</a></body></html>
    

    ok so str8 spotted it already :)

    It is what it's.



  • Registered Users Posts: 322 ✭✭Kobie


    Have you written a confirm() function that returns true or false?


  • Advertisement
  • Registered Users Posts: 6,240 ✭✭✭hussey


    Thanks str8away

    Ps I only used that code as an example, so grammer isn't an issue


    just one thing

    I actually used return confirm(&quot; ) rather than return confirm("


  • Closed Accounts Posts: 358 ✭✭CH


    shouldn't this thread be under Webmaster / Flash


Advertisement