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

· 10년 전 · 458

<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년 전 조회 482
10년 전 조회 426
10년 전 조회 445
10년 전 조회 446
10년 전 조회 400
10년 전 조회 414
10년 전 조회 618
10년 전 조회 828
10년 전 조회 642
10년 전 조회 440
10년 전 조회 436
10년 전 조회 407
10년 전 조회 420
10년 전 조회 527
10년 전 조회 454
10년 전 조회 369
10년 전 조회 416
10년 전 조회 810
10년 전 조회 1,270
10년 전 조회 834
10년 전 조회 633
10년 전 조회 606
10년 전 조회 466
10년 전 조회 462
10년 전 조회 474
10년 전 조회 442
10년 전 조회 459
10년 전 조회 488
10년 전 조회 618
10년 전 조회 527
10년 전 조회 1,260
10년 전 조회 813
10년 전 조회 535
10년 전 조회 607
10년 전 조회 864
10년 전 조회 585
10년 전 조회 721
10년 전 조회 556
10년 전 조회 671
10년 전 조회 501
10년 전 조회 483
10년 전 조회 477
10년 전 조회 528
10년 전 조회 492
10년 전 조회 542
10년 전 조회 539
10년 전 조회 527
10년 전 조회 683
10년 전 조회 695
10년 전 조회 459
10년 전 조회 763
10년 전 조회 1,117
10년 전 조회 560
10년 전 조회 791
10년 전 조회 800
10년 전 조회 626
10년 전 조회 565
10년 전 조회 546
10년 전 조회 643
10년 전 조회 420
10년 전 조회 443
10년 전 조회 660
10년 전 조회 503
10년 전 조회 452
10년 전 조회 451
10년 전 조회 469
10년 전 조회 463
10년 전 조회 445
10년 전 조회 449
10년 전 조회 476
10년 전 조회 584
10년 전 조회 418
10년 전 조회 440
10년 전 조회 518
10년 전 조회 1,254
10년 전 조회 480
10년 전 조회 466
10년 전 조회 589
10년 전 조회 481
10년 전 조회 655
10년 전 조회 585
10년 전 조회 466
10년 전 조회 471
10년 전 조회 520
10년 전 조회 511
10년 전 조회 406
10년 전 조회 405
10년 전 조회 370
10년 전 조회 411
10년 전 조회 815
10년 전 조회 414
10년 전 조회 532
10년 전 조회 444
10년 전 조회 644
10년 전 조회 460
10년 전 조회 379
10년 전 조회 417
10년 전 조회 445
10년 전 조회 565
10년 전 조회 511
🐛 버그신고