sitelink1 | |
---|---|
sitelink2 | |
sitelink3 | |
sitelink4 | |
extra_vars4 | |
extra_vars5 | |
extra_vars6 |
Syntax
object.insertAdjacentHTML(sWhere, sText)
Parameters
sWhere Required. String that specifies where to insert the HTML text, using one of the following values: beforeBegin Inserts sText immediately before the object.
afterBegin Inserts sText after the start of the object but before all other content in the object.
beforeEnd Inserts sText immediately before the end of the object but after all other content in the object.
afterEnd Inserts sText immediately after the end of the object.
sText Required. String that specifies the HTML text to insert. The string can be a combination of text and HTML tags. This must be well-formed, valid HTML or this method will fail.
Return Value
No return value.
Example
var sHTML="<input type=button onclick=" +
"go2()" + " value='Click Me'><BR>"
var sScript='<SCRIPT DEFER>'
sScript = sScript +
'function go2(){ alert("Hello from inserted script.") }'
sScript = sScript + '</script' + '>';
ScriptDiv.insertAdjacentHTML("afterBegin",sHTML + sScript);
object.insertAdjacentHTML(sWhere, sText)
Parameters
sWhere Required. String that specifies where to insert the HTML text, using one of the following values: beforeBegin Inserts sText immediately before the object.
afterBegin Inserts sText after the start of the object but before all other content in the object.
beforeEnd Inserts sText immediately before the end of the object but after all other content in the object.
afterEnd Inserts sText immediately after the end of the object.
sText Required. String that specifies the HTML text to insert. The string can be a combination of text and HTML tags. This must be well-formed, valid HTML or this method will fail.
Return Value
No return value.
Example
var sHTML="<input type=button onclick=" +
"go2()" + " value='Click Me'><BR>"
var sScript='<SCRIPT DEFER>'
sScript = sScript +
'function go2(){ alert("Hello from inserted script.") }'
sScript = sScript + '</script' + '>';
ScriptDiv.insertAdjacentHTML("afterBegin",sHTML + sScript);
댓글 0
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
30 | 자바 스크립트에서 sleep 기능을~ | 황제낙엽 | 2008.10.02 | 32 |
29 | position스타일과 top, left스타일 | 황제낙엽 | 2008.09.24 | 28 |
28 | 자바스크립트에서 이벤트 처리에 대한 일련의 흐름 | 황제낙엽 | 2008.09.18 | 36 |
27 | URL 리다이렉트 (redirect) | 황제낙엽 | 2008.04.18 | 32 |
26 | 감추기, 보이기 화면 예제 | 황제낙엽 | 2008.04.14 | 21 |
25 | Date객체 - 날짜구하기 | 황제낙엽 | 2008.02.19 | 24 |
24 | JavaScript TDD by 강규영 | 황제낙엽 | 2007.11.26 | 31 |
23 | Page Refresh/Reload | 황제낙엽 | 2007.08.24 | 197 |
22 | Javascript 내장객체 String | 황제낙엽 | 2007.04.10 | 392 |
21 | 유용한 자바스크립트 예제 몇가지 (Tree 및...) | 황제낙엽 | 2005.10.20 | 26 |
20 | SelectBox 밑에 CheckBox가 포함된 리스트 만들기 | 황제낙엽 | 2007.01.16 | 178 |
19 | 3시간 걸려서 만든 입력폼 자릿수체크 스크립트 | 황제낙엽 | 2006.04.22 | 48 |
18 | innerHTML | 황제낙엽 | 2005.12.19 | 67 |
» | insertAdjacentHTML Method | 황제낙엽 | 2005.12.19 | 50 |
16 | 폼으로 XML 데이터 전송 (JSP+Javascript) | 황제낙엽 | 2005.12.04 | 43 |
15 | Methods and properties of Microsoft.XMLDOM | 황제낙엽 | 2005.12.04 | 39 |
14 | 슬라이딩 메뉴 | 황제낙엽 | 2005.12.02 | 18 |
13 | XML+JS 연동 다중셀렉트박스 (1) - <font color="brown">(MS Explorer 전용)</brown> | 황제낙엽 | 2005.12.02 | 23 |
12 | 풍선 도움말 | 황제낙엽 | 2005.11.24 | 18 |
11 | 소스 보기 막기 | 황제낙엽 | 2005.11.18 | 168 |