Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- sql랭킹
- xmldom
- SPLIT
- 한글입력체크
- JavaScript
- 자바기초
- 이미지세로길이
- javascript 한글입력체크
- VARIABLE
- update
- jdbc driver
- instr
- asp함수
- injection
- join
- inner join
- ERD
- WML
- XML
- 이미지가로길이
- array
- FileSystemObject
- sql업데이트
- 정규식
- 인젝션
- MSSQL보안
- tempDB
- wap
- VarType
- sql순위
Archives
- Today
- Total
3초기억력
HTML TAG 삭제 자바스크립트 본문
제목 : HTML TAG 삭제 자바스크립트
소스 :
<script type="text/javascript">
<!--
function stripHTML(html)
{
try {
var doc = document.implementation.createDocument('http://www.w3.org/1999/xhtml', 'html', null);
doc.documentElement.innerHTML = html;
return doc.documentElement.textContent||doc.documentElement.innerText;
} catch(e) {
return "";
}
}
//-->
</script>
내용 :
f.userURL.value = stripHTML(f.userURL.value);
이런 식으로 이용 가능함.
예제 소스 파일 :
출처 : http://stackoverflow.com/questions/822452/strip-html-from-text-javascript
'코딩_javascript' 카테고리의 다른 글
매번 까먹는 javascript - checkbox 멀티 선택 value 처리 (0) | 2017.01.26 |
---|---|
easyTree.js 사용하여 트리메뉴 구조 중, 이동 처리시 샘플 html (0) | 2016.12.01 |
다른 form 의 name, value 를 가져오는 방법 (0) | 2016.04.14 |
WEB - HTML5 Desktop Notifications (0) | 2015.09.10 |
SNS 내보내기. 공유. 페이스북, 트위터, 밴드, 카카오스토리 SNS 에 글 공유 / 내보내기 (0) | 2015.06.02 |
Comments