dongshan6870 2018-12-07 15:56
浏览 142
已采纳

在php echo中需要帮助按钮href

i have the following codeline:

//onclick="location.href='http://www.example.com'"
echo "<button type='button' class='single_add_to_cart_button button alt wdm_enquiry' style='background:rgb(0, 171, 0) none repeat scroll 0% 0%';>Ihre ".$post_name." Testversion anfordern!</button>";

The onclick need to include in the echo, but i cant do this.

Anyone can help me out?

  • 写回答

1条回答 默认 最新

  • duandaiqin6080 2018-12-07 16:40
    关注

    You can just write it like this:

    echo "<button type='button' onclick=\"location.href='http://www.example.com'\" class='single_add_to_cart_button button alt wdm_enquiry' style='background:rgb(0, 171, 0) none repeat scroll 0% 0%';>Ihre $post_name Testversion anfordern!</button>";
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?