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

· 10년 전 · 515

<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년 전 조회 539
10년 전 조회 477
10년 전 조회 490
10년 전 조회 493
10년 전 조회 453
10년 전 조회 462
10년 전 조회 675
10년 전 조회 886
10년 전 조회 691
10년 전 조회 493
10년 전 조회 495
10년 전 조회 455
10년 전 조회 474
10년 전 조회 575
10년 전 조회 508
10년 전 조회 424
10년 전 조회 474
10년 전 조회 867
10년 전 조회 1,318
10년 전 조회 890
10년 전 조회 688
10년 전 조회 656
10년 전 조회 525
10년 전 조회 503
10년 전 조회 532
10년 전 조회 500
10년 전 조회 514
10년 전 조회 543
10년 전 조회 671
10년 전 조회 579
10년 전 조회 1,312
10년 전 조회 872
10년 전 조회 587
10년 전 조회 664
10년 전 조회 926
10년 전 조회 647
10년 전 조회 775
10년 전 조회 614
10년 전 조회 718
10년 전 조회 548
10년 전 조회 538
10년 전 조회 530
10년 전 조회 579
10년 전 조회 540
10년 전 조회 598
10년 전 조회 598
10년 전 조회 586
10년 전 조회 742
10년 전 조회 750
10년 전 조회 516
10년 전 조회 820
10년 전 조회 1,175
10년 전 조회 621
10년 전 조회 855
10년 전 조회 854
10년 전 조회 685
10년 전 조회 622
10년 전 조회 604
10년 전 조회 699
10년 전 조회 476
10년 전 조회 510
10년 전 조회 725
10년 전 조회 561
10년 전 조회 522
10년 전 조회 504
10년 전 조회 515
10년 전 조회 525
10년 전 조회 501
10년 전 조회 518
10년 전 조회 540
10년 전 조회 639
10년 전 조회 475
10년 전 조회 497
10년 전 조회 586
10년 전 조회 1,333
10년 전 조회 537
10년 전 조회 530
10년 전 조회 661
10년 전 조회 548
10년 전 조회 730
10년 전 조회 646
10년 전 조회 538
10년 전 조회 538
10년 전 조회 589
10년 전 조회 581
10년 전 조회 475
10년 전 조회 476
10년 전 조회 436
10년 전 조회 486
10년 전 조회 880
10년 전 조회 487
10년 전 조회 605
10년 전 조회 519
10년 전 조회 725
10년 전 조회 529
10년 전 조회 456
10년 전 조회 500
10년 전 조회 520
10년 전 조회 650
10년 전 조회 582
🐛 버그신고