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

· 10년 전 · 490

<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년 전 조회 516
10년 전 조회 458
10년 전 조회 467
10년 전 조회 472
10년 전 조회 434
10년 전 조회 437
10년 전 조회 648
10년 전 조회 860
10년 전 조회 671
10년 전 조회 468
10년 전 조회 472
10년 전 조회 437
10년 전 조회 449
10년 전 조회 552
10년 전 조회 489
10년 전 조회 399
10년 전 조회 451
10년 전 조회 839
10년 전 조회 1,299
10년 전 조회 864
10년 전 조회 666
10년 전 조회 636
10년 전 조회 504
10년 전 조회 484
10년 전 조회 504
10년 전 조회 476
10년 전 조회 487
10년 전 조회 522
10년 전 조회 654
10년 전 조회 553
10년 전 조회 1,297
10년 전 조회 852
10년 전 조회 563
10년 전 조회 639
10년 전 조회 908
10년 전 조회 624
10년 전 조회 756
10년 전 조회 590
10년 전 조회 699
10년 전 조회 527
10년 전 조회 510
10년 전 조회 506
10년 전 조회 557
10년 전 조회 519
10년 전 조회 578
10년 전 조회 573
10년 전 조회 559
10년 전 조회 722
10년 전 조회 724
10년 전 조회 490
10년 전 조회 794
10년 전 조회 1,155
10년 전 조회 596
10년 전 조회 833
10년 전 조회 836
10년 전 조회 665
10년 전 조회 592
10년 전 조회 585
10년 전 조회 683
10년 전 조회 456
10년 전 조회 490
10년 전 조회 705
10년 전 조회 535
10년 전 조회 495
10년 전 조회 485
10년 전 조회 496
10년 전 조회 498
10년 전 조회 476
10년 전 조회 485
10년 전 조회 515
10년 전 조회 609
10년 전 조회 452
10년 전 조회 473
10년 전 조회 557
10년 전 조회 1,306
10년 전 조회 513
10년 전 조회 506
10년 전 조회 637
10년 전 조회 521
10년 전 조회 700
10년 전 조회 625
10년 전 조회 509
10년 전 조회 509
10년 전 조회 563
10년 전 조회 559
10년 전 조회 452
10년 전 조회 445
10년 전 조회 406
10년 전 조회 457
10년 전 조회 856
10년 전 조회 459
10년 전 조회 574
10년 전 조회 487
10년 전 조회 693
10년 전 조회 503
10년 전 조회 421
10년 전 조회 473
10년 전 조회 488
10년 전 조회 620
10년 전 조회 556
🐛 버그신고