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

· 10년 전 · 449

<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년 전 조회 478
10년 전 조회 424
10년 전 조회 439
10년 전 조회 439
10년 전 조회 395
10년 전 조회 409
10년 전 조회 610
10년 전 조회 821
10년 전 조회 637
10년 전 조회 435
10년 전 조회 431
10년 전 조회 400
10년 전 조회 414
10년 전 조회 520
10년 전 조회 444
10년 전 조회 360
10년 전 조회 411
10년 전 조회 805
10년 전 조회 1,263
10년 전 조회 829
10년 전 조회 628
10년 전 조회 600
10년 전 조회 461
10년 전 조회 454
10년 전 조회 470
10년 전 조회 436
10년 전 조회 454
10년 전 조회 477
10년 전 조회 611
10년 전 조회 517
10년 전 조회 1,249
10년 전 조회 801
10년 전 조회 522
10년 전 조회 600
10년 전 조회 852
10년 전 조회 578
10년 전 조회 712
10년 전 조회 551
10년 전 조회 658
10년 전 조회 488
10년 전 조회 475
10년 전 조회 473
10년 전 조회 521
10년 전 조회 481
10년 전 조회 537
10년 전 조회 532
10년 전 조회 520
10년 전 조회 677
10년 전 조회 692
10년 전 조회 450
10년 전 조회 758
10년 전 조회 1,107
10년 전 조회 556
10년 전 조회 785
10년 전 조회 790
10년 전 조회 619
10년 전 조회 557
10년 전 조회 540
10년 전 조회 634
10년 전 조회 408
10년 전 조회 438
10년 전 조회 650
10년 전 조회 495
10년 전 조회 446
10년 전 조회 441
10년 전 조회 459
10년 전 조회 456
10년 전 조회 437
10년 전 조회 440
10년 전 조회 472
10년 전 조회 572
10년 전 조회 412
10년 전 조회 430
10년 전 조회 510
10년 전 조회 1,248
10년 전 조회 474
10년 전 조회 458
10년 전 조회 582
10년 전 조회 472
10년 전 조회 646
10년 전 조회 579
10년 전 조회 458
10년 전 조회 461
10년 전 조회 510
10년 전 조회 505
10년 전 조회 397
10년 전 조회 400
10년 전 조회 360
10년 전 조회 404
10년 전 조회 807
10년 전 조회 407
10년 전 조회 523
10년 전 조회 436
10년 전 조회 638
10년 전 조회 453
10년 전 조회 373
10년 전 조회 409
10년 전 조회 438
10년 전 조회 555
10년 전 조회 507
🐛 버그신고