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

· 10년 전 · 437

<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년 전 조회 459
10년 전 조회 415
10년 전 조회 426
10년 전 조회 421
10년 전 조회 387
10년 전 조회 390
10년 전 조회 603
10년 전 조회 807
10년 전 조회 622
10년 전 조회 421
10년 전 조회 417
10년 전 조회 390
10년 전 조회 398
10년 전 조회 514
10년 전 조회 431
10년 전 조회 352
10년 전 조회 399
10년 전 조회 788
10년 전 조회 1,249
10년 전 조회 817
10년 전 조회 610
10년 전 조회 587
10년 전 조회 449
10년 전 조회 441
10년 전 조회 455
10년 전 조회 421
10년 전 조회 442
10년 전 조회 468
10년 전 조회 602
10년 전 조회 504
10년 전 조회 1,232
10년 전 조회 787
10년 전 조회 510
10년 전 조회 590
10년 전 조회 839
10년 전 조회 561
10년 전 조회 701
10년 전 조회 543
10년 전 조회 646
10년 전 조회 477
10년 전 조회 456
10년 전 조회 454
10년 전 조회 505
10년 전 조회 469
10년 전 조회 520
10년 전 조회 524
10년 전 조회 504
10년 전 조회 664
10년 전 조회 676
10년 전 조회 438
10년 전 조회 741
10년 전 조회 1,088
10년 전 조회 541
10년 전 조회 772
10년 전 조회 771
10년 전 조회 604
10년 전 조회 542
10년 전 조회 519
10년 전 조회 614
10년 전 조회 387
10년 전 조회 422
10년 전 조회 636
10년 전 조회 478
10년 전 조회 439
10년 전 조회 428
10년 전 조회 438
10년 전 조회 439
10년 전 조회 417
10년 전 조회 427
10년 전 조회 452
10년 전 조회 558
10년 전 조회 399
10년 전 조회 414
10년 전 조회 491
10년 전 조회 1,236
10년 전 조회 459
10년 전 조회 435
10년 전 조회 564
10년 전 조회 448
10년 전 조회 629
10년 전 조회 561
10년 전 조회 437
10년 전 조회 444
10년 전 조회 489
10년 전 조회 486
10년 전 조회 378
10년 전 조회 386
10년 전 조회 336
10년 전 조회 384
10년 전 조회 790
10년 전 조회 393
10년 전 조회 499
10년 전 조회 419
10년 전 조회 617
10년 전 조회 430
10년 전 조회 355
10년 전 조회 389
10년 전 조회 414
10년 전 조회 534
10년 전 조회 490
🐛 버그신고