现在的位置: 首页 > 综合 > 正文

js replace dom element in html

2013年01月05日 ⁄ 综合 ⁄ 共 402字 ⁄ 字号 评论关闭

step 1.

new a html file

 

<html>
<head>
<link type="text/css" href="example.css" rel="stylesheet" />
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body>
<script language="javascript" type="text/javascript" src="example.js"></script>

<div>your dom elements</div>
</html>

 

 

step 2.

new a js file name example.js. following is the simple code

 

var mydom = "here am i";

document.writ(mydom);

//padding-right:18px; is so useful

抱歉!评论已关闭.