我的锚标签不是在PHP中使用javascript函数和我的内联样式表

时间:2015-01-08 08:03:41

标签: javascript php jquery html css

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>";

请帮助将javascript与内联样式表绑定。任何帮助,将不胜感激。

4 个答案:

答案 0 :(得分:1)

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

检查

<div onclick="javascript:alert('You have already send a request for buying this ticket')">CLICK HERE </div>
编辑:链接颜色为绿色

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

答案 1 :(得分:1)

在你的任务中

 <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>

你的引用风格不是最佳的

答案 2 :(得分:1)

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>"; }

这是正确的答案问题已解决

答案 3 :(得分:0)

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