clone() - 複製目前元素 包誇HTML裡的文字
each() - 不具名函式只是帶有要對每個選出的元素執行動作的函式
.change{
float: right;
clear: right;
width: 300px;
padding: 20px;
font-size: 30px;
background-color: rgba(250, 211, 224, 0.9);
border-radius: 8px;
margin: 20px 0 10px 10px;
};
<span class="qt"></span>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('span.qt').each(function(){
var quote=$(this).clone();
quote.removeClass('qt');
quote.addClass('change');
$(this).before();
});//end each
});//end document
</script>
2016年1月19日 星期二
Related Posts
input radio判別資料
<input name="isExampleTourReal" value="true" type="radio" checked>是 <input name="isExampleTourReal" value="fa...JQuery-UI日曆設置
首先到Jquery-ui 下載 接下來匯入 CSS 以及 JQuery-ui (#再匯入前記得先匯入JQuery 不然會無法支援) 設定方面 我會先使用變數把要改的東西先存進去 <script> var da...
訂閱:
張貼留言 (Atom)
0 意見:
張貼留言
Click to see the code!
To insert emoticon you must added at least one space before the code.