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

· 10년 전 · 412

<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년 전 조회 436
10년 전 조회 390
10년 전 조회 402
10년 전 조회 399
10년 전 조회 364
10년 전 조회 367
10년 전 조회 578
10년 전 조회 786
10년 전 조회 596
10년 전 조회 399
10년 전 조회 391
10년 전 조회 367
10년 전 조회 371
10년 전 조회 487
10년 전 조회 406
10년 전 조회 324
10년 전 조회 372
10년 전 조회 763
10년 전 조회 1,222
10년 전 조회 793
10년 전 조회 579
10년 전 조회 559
10년 전 조회 431
10년 전 조회 415
10년 전 조회 427
10년 전 조회 394
10년 전 조회 420
10년 전 조회 439
10년 전 조회 571
10년 전 조회 476
10년 전 조회 1,205
10년 전 조회 762
10년 전 조회 486
10년 전 조회 564
10년 전 조회 820
10년 전 조회 539
10년 전 조회 671
10년 전 조회 513
10년 전 조회 619
10년 전 조회 451
10년 전 조회 428
10년 전 조회 427
10년 전 조회 481
10년 전 조회 445
10년 전 조회 499
10년 전 조회 492
10년 전 조회 479
10년 전 조회 638
10년 전 조회 647
10년 전 조회 413
10년 전 조회 710
10년 전 조회 1,062
10년 전 조회 515
10년 전 조회 743
10년 전 조회 748
10년 전 조회 575
10년 전 조회 524
10년 전 조회 488
10년 전 조회 586
10년 전 조회 361
10년 전 조회 394
10년 전 조회 611
10년 전 조회 451
10년 전 조회 410
10년 전 조회 397
10년 전 조회 412
10년 전 조회 413
10년 전 조회 387
10년 전 조회 403
10년 전 조회 431
10년 전 조회 527
10년 전 조회 366
10년 전 조회 396
10년 전 조회 468
10년 전 조회 1,208
10년 전 조회 420
10년 전 조회 409
10년 전 조회 537
10년 전 조회 416
10년 전 조회 598
10년 전 조회 528
10년 전 조회 411
10년 전 조회 408
10년 전 조회 462
10년 전 조회 458
10년 전 조회 350
10년 전 조회 355
10년 전 조회 307
10년 전 조회 359
10년 전 조회 759
10년 전 조회 372
10년 전 조회 476
10년 전 조회 393
10년 전 조회 590
10년 전 조회 402
10년 전 조회 336
10년 전 조회 364
10년 전 조회 384
10년 전 조회 508
10년 전 조회 458
🐛 버그신고