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

· 10년 전 · 549

<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년 전 조회 564
10년 전 조회 505
10년 전 조회 525
10년 전 조회 520
10년 전 조회 486
10년 전 조회 494
10년 전 조회 694
10년 전 조회 900
10년 전 조회 721
10년 전 조회 520
10년 전 조회 527
10년 전 조회 479
10년 전 조회 510
10년 전 조회 607
10년 전 조회 531
10년 전 조회 456
10년 전 조회 499
10년 전 조회 895
10년 전 조회 1,344
10년 전 조회 908
10년 전 조회 719
10년 전 조회 689
10년 전 조회 548
10년 전 조회 538
10년 전 조회 560
10년 전 조회 530
10년 전 조회 542
10년 전 조회 572
10년 전 조회 697
10년 전 조회 616
10년 전 조회 1,342
10년 전 조회 895
10년 전 조회 615
10년 전 조회 695
10년 전 조회 944
10년 전 조회 670
10년 전 조회 812
10년 전 조회 647
10년 전 조회 755
10년 전 조회 591
10년 전 조회 569
10년 전 조회 566
10년 전 조회 616
10년 전 조회 570
10년 전 조회 635
10년 전 조회 636
10년 전 조회 613
10년 전 조회 774
10년 전 조회 782
10년 전 조회 550
10년 전 조회 851
10년 전 조회 1,200
10년 전 조회 657
10년 전 조회 889
10년 전 조회 880
10년 전 조회 721
10년 전 조회 656
10년 전 조회 634
10년 전 조회 736
10년 전 조회 507
10년 전 조회 535
10년 전 조회 757
10년 전 조회 595
10년 전 조회 548
10년 전 조회 529
10년 전 조회 546
10년 전 조회 565
10년 전 조회 539
10년 전 조회 555
10년 전 조회 572
10년 전 조회 676
10년 전 조회 504
10년 전 조회 535
10년 전 조회 616
10년 전 조회 1,355
10년 전 조회 568
10년 전 조회 562
10년 전 조회 684
10년 전 조회 576
10년 전 조회 754
10년 전 조회 667
10년 전 조회 557
10년 전 조회 564
10년 전 조회 616
10년 전 조회 606
10년 전 조회 503
10년 전 조회 496
10년 전 조회 463
10년 전 조회 507
10년 전 조회 905
10년 전 조회 509
10년 전 조회 632
10년 전 조회 539
10년 전 조회 750
10년 전 조회 565
10년 전 조회 474
10년 전 조회 528
10년 전 조회 548
10년 전 조회 682
10년 전 조회 616
🐛 버그신고