html body table내 글자 검색 리스트 검색1 검색2 $(document).ready(function() { //이름 검색 $("#keyword").keyup(function() { var k = $(this).val(); $("#id > tbody > tr").hide(); var temp = $("#id > tbody > tr > td:contains('" + k + "')"); $(temp).parent().show(); }) })
[javascript] 텍스트 복사하기 기능(ie, 크롬,엣지 모두 호환 가능) var IE = (document.all)?true:false; //ie 전용 복사하기 var v_content = document.getElementById("txt").value if(IE){ window.clipboardData.setData('Text',v_content); }else{ //크롬/엣지 전용 복사하기 var copyText = document.createElement("textarea"); document.body.appendChild(copyText); copyText.value = v_content; copyText.select(); document.execCommand('copy'); documen..
[javascript] textarea 라인 제한, 자리수 제한 html 소스 javascript 소스 /** * textarea * 라인 제한 line:4 * 길이 제한 maxlength 100 */ function checkLine(frm, line, maxlength) { var charK; var lineCnt = 0; var curlen = frm.value.length; var strValue = frm.value; for(k=0;k= line) { alert(line + "라인까지 사용 가능합니다."); lineCnt = 0; frm.value = strValue.substring(0,curlen - 1); break; } if(maxlength
//소스메뉴 보기 방지 document.oncontextmenu = function () { // Use document as opposed to window for IE8 compatibility return false; }; //마우스 드래그 방지 document.ondragstart = function () { return false; }; //본문 복사 방지 document.onselectstart = function () { return false; };
box 클래스 자식 요소의 li class가 btt인 클릭 시에 버튼 클릭 시에 버튼 색깔 칠해주기 class가 "on"일 경우에 색이 칠해진다고 가정하고 클릭하면 class="on" 다시 클릭하면 class="off"가 됩니다. 보통은 아래와 같이 off를 지우고 on을 넣을텐데요. //off 상태에서 클릭 시 $('.box li[class^="btt"]').removeClass("off").addClass("on") //on 상태에서 클릭 시 $('.box li[class^="btt"]').removeClass("on").addClass("off") 간단하게 위에 코드를 한 줄로 만들어줍시다. $(document).on('click', '.box li[class^="btt"]', function(){..