bootstrap模態框怎么傳遞參數


bootstrap參數傳遞可以用 data-參數名 

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <link href="css/bootstrap-3.3.4-dist/css/bootstrap.min.css" rel="stylesheet" />
    <script src="js/jquery-2.1.3.min.js"></script>
    <script src="css/bootstrap-3.3.4-dist/js/bootstrap.min.js"></script>
   <script type="text/javascript">
       $(function () {
           console.log($('#test').data('user'));
           console.log($('#test').data('names'));
       })
   </script>
</head>
<body>
    <div id="test" data-user="張三" data-names="小李4啊"></div> 
</body>
</html>

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM