简体   繁体   中英

My anchor tag is not taking javascript function and my inline style sheet in php

 else { echo" <td style='color:green' onclick=alert '('You have already send a request for buying this ticket ')'><a href='sell.php?buy=" . $b_id . "&usr=" . $buyer_id . "&sell=" . $s_id . "'> Resend Your detail </a> </td>"; echo" </tr>"; 

Please help to bind javascript with inline style sheet . Any help would be appreciated.

onclick=\"javascript:alert('You have already send a request for buying this ticket')\"

Check this

 <div onclick="javascript:alert('You have already send a request for buying this ticket')">CLICK HERE </div> 
EDIT: for link color green

 <a style='color:green' href='sell.php?buy=" . $b_id . "&usr=" . $buyer_id . "&sell=" . $s_id . "'> Resend Your detail </a> 

In your task

 <td style='color:green' onclick=\"javascript:alert('You have already send a request for buying this ticket')\"><a href='sell.php?buy=" . $b_id . "&usr=" . $buyer_id . "&sell=" . $s_id . "'> Resend Your detail </a>

Btw your quoting-style is not optimal

 else { echo" <td onclick=\\ "javascript:alert('You details is resend ')\\"><a style=\\ "color:green\\" href='sell.php?buy=" . $b_id . "&usr=" . $buyer_id . "&sell=" . $s_id . "'> Resend Your detail </a>"; echo" </tr>"; } 

This Is right Answer problem solved

onclick=\"javascript:alert('You have already send a request for buying this ticket')\"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM