LazyDreamy

관리자 | 글쓰기

LazyDreamy » Computer/Programming

jQuery Input field control

드림 | 2010/05/18 15:58

text

get   $(‘input[name=inputname]’).val();

set   $(‘input[name=inputname]’).val(‘value’);


selectbox

get   $(‘select[name=selectname] > option:selected’).val();

set   $(‘select[name=selectname] > option[value=selectvalue]’).attr(‘selected’, ‘true’);


radio , checkbox

get   $(‘input[name=inputname]:checked’).val();

set   $(‘input[name=inputname]’).filter('input[value=selectvalue]').attr(‘checked’, ‘checked’);

set   $(‘input[name=inputname]’).filter('input[value=selectvalue]').attr(‘checked’, ‘’);

count    $(‘input[name=inputname]:checkbox:checked’).length;

2010/05/18 15:58 2010/05/18 15:58


태그

(go to top)

LazyDreamy » Computer/Programming

jQuery Text Highlighter plugin

드림 | 2010/05/18 10:01

http://www.unwrongest.com/projects/highlight/


How to use Highlight

You can throw both a string or an array on Highlight. Have a look at the example below. The first row is going to highlight the word acknowledgment, the second row is going to highlight both ‘matching’ and ‘class name’. The code shown in the example below has been executed in this page.

	$('.body').highlight("acknowledgment");
	$('.body').highlight(["matching","class name"]);

What actually happens is that the matching phrases are wrapped inside a span element with the class name highlight. Therefor you will also need to add some css code to get a visual result.

.highlight { background: #ff0; }
2010/05/18 10:01 2010/05/18 10:01


태그

(go to top)

LazyDreamy » Diary

문학 경기장

드림 | 2010/05/17 00:25

IMGP0407

SK vs 두산

2010/05/17 00:25 2010/05/17 00:25


(go to top)

LazyDreamy » Diary

저녘 메뉴!

드림 | 2010/05/08 20:42

IMGP0378

IMGP0367

닭강정 + 닭날개!

 

그리고 맥주! –ㅂ-);

2010/05/08 20:42 2010/05/08 20:42


(go to top)

LazyDreamy » Diary

5/8

드림 | 2010/05/07 21:36

IMGP0353
2010/05/07 21:36 2010/05/07 21:36


(go to top)

◀ recent | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | ... 81 | previous ▶