Notice
Recent Posts
Tags
- findindex
- ecma6
- dom event
- unobtrusive javascript
- body-parser
- express 서버
- requirejs
- ecmascript method
- 마임타입
- supervisor
- 컨텐츠 중간 위치
- IIS 서버
- 미들웨어
- Git
- displaytable
- jQuery
- CSS
- array method
- ajax
- javascript
- mysql
- 겸손한 자바스크립트
- css3 셀렉터
- javascript 이론
- 관계형 데이터 베이스
- nodejs
- database 개념
- css3 selector
- ecma script
- 배열 메소드
Link
목록attr 다중처리 (1)
Martin`s Work
[JQuery] 다중 attr 처리
아래와 같이 상황에 따라 attr를 다중으로 줘야하는 경우가 존재한다. 123$("img").attr("src","img.png");$("img").attr("alt","이미지 부가 설명");$("img").attr("title","지금 보시는 이미지는 이미지입니다.");cs 위의 소스를 보면 가독성도 좋지 않고, 소스 역시 깔끔하지 못하다. 이러한 경우 아래와 같이 다중 attr을 한번에 처리하면 보다 편리하고 깔끔하게 소스를 정리할 수 있다. 12345$("img").attr({ "src":"img.png", "alt":"이미지 부가 설명", "title":"지금 보시는 이미지는 이미지입니다."})Colored by Color Scriptercs
Javascript/Jquery
2017. 4. 20. 14:38