在html页面中使用js变量
Method 1:
<a id=
"xxxx"
>xxxxxxxxxxxxxxxxxx</a>
<script type=
"text/javascript"
>
var
id = 1356;
document.getElementById(
"xxxx"
).href=
"delete?pid="
+id;
</script>
Method 2:
<script type=
"text/javascript"
>
var
id = 1356;
document.write(
'<a href="delete?pid='
+id+
'">xxxxxxxxxxxxxxxxxx</a>'
);
</script>
Method 3: