dongshan6870
2018-12-07 23:56
浏览 140
已采纳

在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-08 00: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>";
    
    已采纳该答案
    打赏 评论

相关推荐 更多相似问题