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

· 10년 전 · 509

<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년 전 조회 533
10년 전 조회 475
10년 전 조회 486
10년 전 조회 490
10년 전 조회 449
10년 전 조회 456
10년 전 조회 668
10년 전 조회 882
10년 전 조회 686
10년 전 조회 490
10년 전 조회 491
10년 전 조회 449
10년 전 조회 471
10년 전 조회 573
10년 전 조회 506
10년 전 조회 421
10년 전 조회 470
10년 전 조회 862
10년 전 조회 1,317
10년 전 조회 886
10년 전 조회 682
10년 전 조회 655
10년 전 조회 520
10년 전 조회 501
10년 전 조회 532
10년 전 조회 497
10년 전 조회 510
10년 전 조회 539
10년 전 조회 667
10년 전 조회 570
10년 전 조회 1,308
10년 전 조회 865
10년 전 조회 580
10년 전 조회 659
10년 전 조회 925
10년 전 조회 644
10년 전 조회 771
10년 전 조회 610
10년 전 조회 715
10년 전 조회 544
10년 전 조회 534
10년 전 조회 524
10년 전 조회 576
10년 전 조회 533
10년 전 조회 594
10년 전 조회 590
10년 전 조회 583
10년 전 조회 738
10년 전 조회 742
10년 전 조회 510
10년 전 조회 814
10년 전 조회 1,174
10년 전 조회 617
10년 전 조회 850
10년 전 조회 850
10년 전 조회 681
10년 전 조회 619
10년 전 조회 599
10년 전 조회 697
10년 전 조회 471
10년 전 조회 504
10년 전 조회 721
10년 전 조회 555
10년 전 조회 520
10년 전 조회 498
10년 전 조회 514
10년 전 조회 522
10년 전 조회 495
10년 전 조회 513
10년 전 조회 537
10년 전 조회 634
10년 전 조회 469
10년 전 조회 493
10년 전 조회 579
10년 전 조회 1,330
10년 전 조회 531
10년 전 조회 525
10년 전 조회 659
10년 전 조회 544
10년 전 조회 726
10년 전 조회 642
10년 전 조회 532
10년 전 조회 532
10년 전 조회 582
10년 전 조회 577
10년 전 조회 471
10년 전 조회 471
10년 전 조회 429
10년 전 조회 481
10년 전 조회 878
10년 전 조회 480
10년 전 조회 601
10년 전 조회 516
10년 전 조회 717
10년 전 조회 524
10년 전 조회 448
10년 전 조회 496
10년 전 조회 513
10년 전 조회 647
10년 전 조회 576
🐛 버그신고