모바일 OS에서 자바스크립트 select() 구현하기 입니다.

· 10년 전 · 395

<textarea id="idText">
Hello Apple!
Hello Android!
</textarea>

<script language="javascript" type="text/javascript">
var Mobile="";
var sUsrAgt=navigator.userAgent;

if((/iPhone/i.test(sUsrAgt)) || (/iPod/i.test(sUsrAgt))) Mobile="IP";
else if((/series60/i.test(sUsrAgt)) || (/symbian/i.test(sUsrAgt))) Mobile="SY";
else if(/iPad/i.test(sUsrAgt)) Mobile="IA";
else if(/android/i.test(sUsrAgt)) Mobile="AN";
else if(/windows ce/i.test(sUsrAgt)) Mobile="WM";
else if(/blackberry/i.test(sUsrAgt)) Mobile="BB";
else if(/palm/i.test(sUsrAgt)) Mobile="PM";
else if(/Kindle/i.test(sUsrAgt)) Mobile="KD";

var oTextArea=document.getElementById("idText");

function selectMobile() {
oTextArea.setSelectionRange(0, 9999);
}

function selectAll()
{
if (Mobile) {
oTextArea.focus();
setTimeout("selectMobile()",1234);
}
else {
oTextArea.select();
}
}

selectAll();

</script>

|
댓글을 작성하시려면 로그인이 필요합니다. 로그인

프로그램

+
제목 글쓴이 날짜 조회
10년 전 조회 413
10년 전 조회 366
10년 전 조회 379
10년 전 조회 374
10년 전 조회 343
10년 전 조회 341
10년 전 조회 552
10년 전 조회 762
10년 전 조회 577
10년 전 조회 380
10년 전 조회 376
10년 전 조회 342
10년 전 조회 353
10년 전 조회 464
10년 전 조회 380
10년 전 조회 303
10년 전 조회 352
10년 전 조회 741
10년 전 조회 1,204
10년 전 조회 770
10년 전 조회 558
10년 전 조회 540
10년 전 조회 414
10년 전 조회 396
10년 전 조회 408
10년 전 조회 375
10년 전 조회 399
10년 전 조회 420
10년 전 조회 552
10년 전 조회 458
10년 전 조회 1,180
10년 전 조회 740
10년 전 조회 464
10년 전 조회 537
10년 전 조회 800
10년 전 조회 515
10년 전 조회 646
10년 전 조회 487
10년 전 조회 596
10년 전 조회 426
10년 전 조회 404
10년 전 조회 404
10년 전 조회 459
10년 전 조회 419
10년 전 조회 479
10년 전 조회 469
10년 전 조회 457
10년 전 조회 617
10년 전 조회 626
10년 전 조회 395
10년 전 조회 689
10년 전 조회 1,039
10년 전 조회 502
10년 전 조회 723
10년 전 조회 723
10년 전 조회 554
10년 전 조회 502
10년 전 조회 467
10년 전 조회 563
10년 전 조회 337
10년 전 조회 374
10년 전 조회 590
10년 전 조회 424
10년 전 조회 388
10년 전 조회 370
10년 전 조회 389
10년 전 조회 395
10년 전 조회 370
10년 전 조회 378
10년 전 조회 412
10년 전 조회 504
10년 전 조회 340
10년 전 조회 378
10년 전 조회 453
10년 전 조회 1,184
10년 전 조회 396
10년 전 조회 385
10년 전 조회 511
10년 전 조회 386
10년 전 조회 565
10년 전 조회 503
10년 전 조회 389
10년 전 조회 383
10년 전 조회 434
10년 전 조회 433
10년 전 조회 324
10년 전 조회 328
10년 전 조회 282
10년 전 조회 334
10년 전 조회 733
10년 전 조회 347
10년 전 조회 450
10년 전 조회 374
10년 전 조회 570
10년 전 조회 381
10년 전 조회 315
10년 전 조회 344
10년 전 조회 368
10년 전 조회 491
10년 전 조회 441
🐛 버그신고