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

· 10년 전 · 551

<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년 전 조회 568
10년 전 조회 509
10년 전 조회 526
10년 전 조회 524
10년 전 조회 487
10년 전 조회 498
10년 전 조회 698
10년 전 조회 903
10년 전 조회 728
10년 전 조회 527
10년 전 조회 531
10년 전 조회 485
10년 전 조회 513
10년 전 조회 607
10년 전 조회 535
10년 전 조회 460
10년 전 조회 502
10년 전 조회 901
10년 전 조회 1,348
10년 전 조회 909
10년 전 조회 721
10년 전 조회 692
10년 전 조회 553
10년 전 조회 540
10년 전 조회 561
10년 전 조회 536
10년 전 조회 544
10년 전 조회 575
10년 전 조회 700
10년 전 조회 618
10년 전 조회 1,347
10년 전 조회 901
10년 전 조회 616
10년 전 조회 701
10년 전 조회 946
10년 전 조회 677
10년 전 조회 814
10년 전 조회 649
10년 전 조회 761
10년 전 조회 594
10년 전 조회 572
10년 전 조회 571
10년 전 조회 617
10년 전 조회 574
10년 전 조회 638
10년 전 조회 640
10년 전 조회 617
10년 전 조회 776
10년 전 조회 788
10년 전 조회 552
10년 전 조회 853
10년 전 조회 1,205
10년 전 조회 660
10년 전 조회 892
10년 전 조회 884
10년 전 조회 723
10년 전 조회 662
10년 전 조회 638
10년 전 조회 738
10년 전 조회 511
10년 전 조회 539
10년 전 조회 762
10년 전 조회 597
10년 전 조회 554
10년 전 조회 532
10년 전 조회 550
10년 전 조회 568
10년 전 조회 540
10년 전 조회 557
10년 전 조회 575
10년 전 조회 678
10년 전 조회 507
10년 전 조회 538
10년 전 조회 622
10년 전 조회 1,356
10년 전 조회 570
10년 전 조회 568
10년 전 조회 687
10년 전 조회 580
10년 전 조회 759
10년 전 조회 672
10년 전 조회 563
10년 전 조회 568
10년 전 조회 621
10년 전 조회 610
10년 전 조회 505
10년 전 조회 501
10년 전 조회 467
10년 전 조회 511
10년 전 조회 910
10년 전 조회 509
10년 전 조회 635
10년 전 조회 540
10년 전 조회 753
10년 전 조회 567
10년 전 조회 475
10년 전 조회 530
10년 전 조회 551
10년 전 조회 687
10년 전 조회 621
🐛 버그신고