您的浏览器不支持JavaScript或者JavaScript的运行被您禁止了。
HTML元素title属性值定义的提示文字实现换行
用
来换行就可以了!比如下面这行代码:将鼠标放于此处查看title属性中定义的提示文字上面那行代码的实际效果如下:将鼠标放于此处查看title属性中定义的提示文字。
暂无评论
HTML块级元素和行内元素
每一个HTML元素的display属性都有一个默认的值。具体的默认值是什么,取决于元素的类型。大部分HTML元素display属性的默认值是block或inline。块级元素块级元素总是另起一个新行,并占满可用宽度(尽可能地向左右两个方向延伸)。<div>元素是一个块级元素。一些块级元素(block-level...
暂无评论
JavaScript和Cookies
cookie简介当网页服务器和你的浏览器“初次见面”时,网页服务器会提供一段独一无二的“信息”给你的服务器,二者此后再“见面”时可以彼此共享这些“信息”。远程服务器会保存这些“信息”,你的浏览器也会把这些“信息”以纯文本的形式保存在你的电脑硬盘中。通过cookie机制,你可以用JavaScript实现许多功能。如果你的网站要求用户进行注册,你可以对cookie进行设定以将你网站读者的用户名和密码保存在他们的计算机硬盘中,这样,你网站的用户就不必在每次访问你网站时都输入一遍用户名和密码了。你可以跟踪到用户访问了你网站的什么地方并统计用户访问的次数。...
暂无评论
JavaScript中的事件
<p class="chinese">当用户的某个行为影响到整个浏览器窗口时,窗口事件就发生了。最常见的窗口事件是通过简单地打开一个网页来加载窗口。关闭、移动窗口或者将窗口置于其他窗口的后面等事件也能触发相应的event hanlder。</p>
暂无评论
Regular Expressions and JavaScript
<p>A <em>regular expression</em> (often abbreviated as <em>RegExp</em> or called by its synonym <em>grep</em>) is a pattern, written using special symbols, which describes one or more text strings. You use regular expressions to match patterns of text, so that your script can easily recognize and manipulate text. Like an arithmetic expression, you create a regular expression by using <em>operators</em>, in this case operators that work on text, rather than numbers. There are many regular expression operators. By learning and using these operators, you'll be able to save yourself a huge amount of effort whenever you need to detect and manipulate text strings.</p>
暂无评论
Uncaught TypeError: Cannot read property 'children' of null
<p>P.S: You should not use "<code style="color: red;">children</code>". It would be better to use "<code style="color: red;">childNodes</code>" instead of the "<code style="color: red;">children</code>". "<code style="color: red;">childNodes</code>" is supported by all major browsers including IE, while "<code style="color: red;">children</code>" (invented by IE) is not well supported by major browsers other than IE. The former conforms to the standard while the later is not.</p>
暂无评论
Forms in HTML
Forms are very common to see in web pages, especially when you are going to register or log in some websites.
暂无评论
parentNode, childNodes, children and parentElement in JavaScript
<p>Note that error may be returned if you place the above code snippet between the opening &lt;head&gt; tag and the closing &lt;head&gt;. This is because that all JavaScript-supported browsers will run these JavaScript code before the DOM is entirely interpreted. If you are using Firefox, the error returned is like: <code style="font-weight: bold; color: red;">document.getElementById("child") has no properties</code>, while the error returned by IE is like: <code style="font-weight: bold; color: red;">Object Required</code>.</p>
暂无评论
evt and window.event in JavaScript
<p>You may want to ask what "thisSquare" here means. A good question! You know, typically, a BINGO game is played on a 5 rows * 5 columns layout (therefore there are 25 cells in total). The above code is aimed to fetch the information that which cell is clicked by the mouse (so you now know "thisSquare" refers to the currently clicked cell). However, the meaning of "thisSquare" is not my concern. I paid much attention to the contents after the equality sign, i.e. "<strong style="color: green;">evt.target</strong>" and "<strong style="color: green;">window.event.srcElement</strong>".</p>
暂无评论
Simplest Image Rollovers Effect Created by JavaScript
<p>The above small code snippet is very simple, but with some problems and drawbacks:</p> <ul> <li style="color: green;">Because the second image is downloaded from the server at the time the user rools over the first image, there can be a perceptible delay before the second image replaces the first one, <strong style="font-weight: bold;">especially for people browsing your site with a slower connection</strong>.</li> <li>Using this method causes an error message in ancient browsers, such as Netscape 2.0 or earlier, Internet Explorer 3.0 or earlier, or the America Online 2.7 browser. Since there are so few of these vintage browsers still in use, it's not much of a problem these days.</li> </ul>
暂无评论
1 2