js代码
<script src="js/jquery-1.8.3.min.js"></script> <script src="js/TouchSlide.1.1.js"></script> <script type="text/javascript"> $(function(){ //答案点击 $(".options").click(function(){ var val=$(this).attr("val"); //题目答案 var ids=$(this).attr("ids"); //题目编号 $("li[ids="+ids+"]").removeClass("click"); $(this).addClass("click"); $("#QuestionA"+ids).val(val); }); }); </script> <script type="text/javascript"> pushHistory(); window.addEventListener("popstate", function(e) { pushHistory(); }, false); function pushHistory() { var state = { title:"title", url:"#" }; window.history.pushState(state, "title", "#"); } </script>