some-div
I'm a paragraph, nice to meet you.
Language | Type | Invented |
---|---|---|
Java | Static | 1995 |
Ruby | Dynamic | 1993 |
Smalltalk | Dynamic | 1972 |
C++ | Static | 1983 |
以下为程序中的javascript 脚本文件
<script > $('#sample-dom-source').text($('#sample-dom').html()); /* 在代码框里。显示代码*/ $('#button-apply').click(function (event) { event.preventDefault(); /*event.target is a DOM object */ // Clear old data $('.found-element', '#sample-dom').removeClass('found-element'); $('#resulting-elements').html(''); // Retrieve the selector var selector = $.trim($('#selector').val()); /* 取得文本输入框的值 */ // Retrieve the matching elements var $set = $(selector, '#sample-dom'); $set.addClass('found-element'); // Output the results $('#jquery-statement').html('$("' + selector + '").addClass("found-element");'); /*html 里输入字符串的格式 */ $('#resulting-elements-count').text($set.length); $set.each(function () { $('#resulting-elements').append( '<div >' + this.tagName + (this.id ? '#' + this.id : '') + '</div >' ); }); }); </script >