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

· 10년 전 · 435

<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년 전 조회 452
10년 전 조회 412
10년 전 조회 425
10년 전 조회 417
10년 전 조회 385
10년 전 조회 385
10년 전 조회 600
10년 전 조회 804
10년 전 조회 620
10년 전 조회 419
10년 전 조회 409
10년 전 조회 387
10년 전 조회 392
10년 전 조회 511
10년 전 조회 426
10년 전 조회 347
10년 전 조회 396
10년 전 조회 782
10년 전 조회 1,242
10년 전 조회 813
10년 전 조회 604
10년 전 조회 578
10년 전 조회 445
10년 전 조회 437
10년 전 조회 447
10년 전 조회 413
10년 전 조회 438
10년 전 조회 463
10년 전 조회 594
10년 전 조회 500
10년 전 조회 1,226
10년 전 조회 783
10년 전 조회 504
10년 전 조회 586
10년 전 조회 835
10년 전 조회 557
10년 전 조회 693
10년 전 조회 538
10년 전 조회 640
10년 전 조회 472
10년 전 조회 448
10년 전 조회 448
10년 전 조회 501
10년 전 조회 467
10년 전 조회 514
10년 전 조회 521
10년 전 조회 502
10년 전 조회 660
10년 전 조회 675
10년 전 조회 436
10년 전 조회 738
10년 전 조회 1,083
10년 전 조회 540
10년 전 조회 765
10년 전 조회 769
10년 전 조회 596
10년 전 조회 537
10년 전 조회 512
10년 전 조회 609
10년 전 조회 384
10년 전 조회 419
10년 전 조회 634
10년 전 조회 473
10년 전 조회 433
10년 전 조회 424
10년 전 조회 431
10년 전 조회 436
10년 전 조회 414
10년 전 조회 424
10년 전 조회 448
10년 전 조회 554
10년 전 조회 392
10년 전 조회 412
10년 전 조회 489
10년 전 조회 1,233
10년 전 조회 451
10년 전 조회 429
10년 전 조회 559
10년 전 조회 441
10년 전 조회 625
10년 전 조회 554
10년 전 조회 433
10년 전 조회 435
10년 전 조회 482
10년 전 조회 479
10년 전 조회 373
10년 전 조회 380
10년 전 조회 333
10년 전 조회 382
10년 전 조회 785
10년 전 조회 388
10년 전 조회 496
10년 전 조회 416
10년 전 조회 612
10년 전 조회 427
10년 전 조회 351
10년 전 조회 385
10년 전 조회 410
10년 전 조회 531
10년 전 조회 486
🐛 버그신고