課程
/前端開發
/JavaScript
/Avalon探索之旅基礎教程---- 簡單綁定
別照老師教的作,肯定實現不了,因為沒有? e.preventDefault();語句,所以實現不了
2018-12-08
源自:Avalon探索之旅基礎教程---- 簡單綁定 1-2
正在回答
<!DOCTYPE html>
<html>
<head>
? <meta charset="UTF-8">
? <title>Document</title>
</head>
<script? src="http://libs.baidu.com/jquery/1.7.2/jquery.min.js"></script>
<link rel="stylesheet" >
<body>
? <div class="container">
? ? <div class="row">
? ? ? <div class="col-md-5">
? ? ? ? <form action="" id="todoForm">
? ? ? ? ? <label for="">xxxx</label>
? ? ? ? ? <input type="text" id="todoInput" class="form-control">
? ? ? ? </form>
? ? ? ? <p id="todoCount"></p>
? ? ? ? <ol id="todoList"></ol>
? ? ? </div>
? ? </div>
? </div>
? <script>
? ? (function(){
? ? ? var $todoForm=$("#todoForm");
? ? ? var $todoInput=$("#todoInput");
? ? ? var $todoList=$("#todoList");? ? ?
? ? ? $todoForm.submit(function(e){? ? ?
? ? ? ? e.preventDefault();
? ? ? ? var input_value = $todoInput.val();
? ? ? ? $todoList.append('<li>'+input_value+' <a href="#" class="todoDelete">X</a></li>');
? ? ? ? $todoInput.val('');
? ? ? });
? ? })();
? </script>
</body>
</html>
?<link rel="stylesheet" >
? ? ? ? <form action="" class="todoForm">
? ? ? ? <p class="todoCount"></p>
舉報
前端迷你MVVM框架avalon的入門視頻教程,趕快加入吧
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2018-12-08
<!DOCTYPE html>
<html>
<head>
? <meta charset="UTF-8">
? <title>Document</title>
</head>
<script? src="http://libs.baidu.com/jquery/1.7.2/jquery.min.js"></script>
<link rel="stylesheet" >
<body>
? <div class="container">
? ? <div class="row">
? ? ? <div class="col-md-5">
? ? ? ? <form action="" id="todoForm">
? ? ? ? ? <label for="">xxxx</label>
? ? ? ? ? <input type="text" id="todoInput" class="form-control">
? ? ? ? </form>
? ? ? ? <p id="todoCount"></p>
? ? ? ? <ol id="todoList"></ol>
? ? ? </div>
? ? </div>
? </div>
? <script>
? ? (function(){
? ? ? var $todoForm=$("#todoForm");
? ? ? var $todoInput=$("#todoInput");
? ? ? var $todoList=$("#todoList");? ? ?
? ? ? $todoForm.submit(function(e){? ? ?
? ? ? ? e.preventDefault();
? ? ? ? var input_value = $todoInput.val();
? ? ? ? $todoList.append('<li>'+input_value+' <a href="#" class="todoDelete">X</a></li>');
? ? ? ? $todoInput.val('');
? ? ? });
? ? })();
? </script>
</body>
</html>
2018-12-08
<!DOCTYPE html>
<html>
<head>
? <meta charset="UTF-8">
? <title>Document</title>
</head>
<script? src="http://libs.baidu.com/jquery/1.7.2/jquery.min.js"></script>
?<link rel="stylesheet" >
<body>
? <div class="container">
? ? <div class="row">
? ? ? <div class="col-md-5">
? ? ? ? <form action="" class="todoForm">
? ? ? ? ? <label for="">xxxx</label>
? ? ? ? ? <input type="text" id="todoInput" class="form-control">
? ? ? ? </form>
? ? ? ? <p class="todoCount"></p>
? ? ? ? <ol id="todoList"></ol>
? ? ? </div>
? ? </div>
? </div>
? <script>
? ? (function(){
? ? ? var $todoForm=$("#todoForm");
? ? ? var $todoInput=$("#todoInput");
? ? ? var $todoList=$("#todoList");? ? ?
? ? ? $todoForm.submit(function(e){? ? ?
? ? ? ? var input_value = $todoInput.val();
? ? ? ? $todoList.append('<li>'+input_value+' <a href="#" class="todoDelete">X</a></li>');
? ? ? });
? ? })();
? </script>
</body>
</html>