Notice
Recent Posts
Tags
- CSS
- ecmascript method
- array method
- nodejs
- body-parser
- mysql
- javascript
- ecma script
- ajax
- unobtrusive javascript
- 미들웨어
- ecma6
- IIS 서버
- javascript 이론
- css3 셀렉터
- Git
- requirejs
- 컨텐츠 중간 위치
- express 서버
- 배열 메소드
- 마임타입
- dom event
- database 개념
- css3 selector
- findindex
- 관계형 데이터 베이스
- jQuery
- displaytable
- 겸손한 자바스크립트
- supervisor
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