doushi1974
2017-02-08 04:53
浏览 82
已采纳

按钮内的HTML-HREF标签

This is my button code, which has a reference tag, and the URL takes me to an index action correctly

<button type="submit" class="btn btn-primary"><a style="color:white" href="<?php echo $this->basePath('calendar/details/index').'?month='.$this->previousMonth?>"> Previous </a></button>

and this is the picture of the button

Preview of current Button

The problem is that only the text Previous on button is clickable, other than that any click on the blue part of the button does not work. How to make the whole area of the button work, without disturbing the URL?

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dongwei4444 2017-02-08 04:56
    已采纳

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
    <a class="btn btn-primary" style="color: white" href="#">Previous</a>

    <a class="btn btn-primary" style="color: white" href="<?php echo $this->basePath('calendar/details/index').'?month='.$this->previousMonth?>">Previous</a>
    
    </div>
    
    已采纳该答案
    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题