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

· 10년 전 · 467

<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년 전 조회 487
10년 전 조회 427
10년 전 조회 446
10년 전 조회 447
10년 전 조회 402
10년 전 조회 414
10년 전 조회 623
10년 전 조회 832
10년 전 조회 645
10년 전 조회 442
10년 전 조회 441
10년 전 조회 409
10년 전 조회 422
10년 전 조회 531
10년 전 조회 459
10년 전 조회 370
10년 전 조회 421
10년 전 조회 813
10년 전 조회 1,276
10년 전 조회 837
10년 전 조회 639
10년 전 조회 612
10년 전 조회 473
10년 전 조회 467
10년 전 조회 479
10년 전 조회 445
10년 전 조회 464
10년 전 조회 492
10년 전 조회 625
10년 전 조회 532
10년 전 조회 1,269
10년 전 조회 823
10년 전 조회 541
10년 전 조회 613
10년 전 조회 871
10년 전 조회 592
10년 전 조회 723
10년 전 조회 560
10년 전 조회 676
10년 전 조회 505
10년 전 조회 486
10년 전 조회 481
10년 전 조회 532
10년 전 조회 500
10년 전 조회 549
10년 전 조회 545
10년 전 조회 533
10년 전 조회 688
10년 전 조회 701
10년 전 조회 468
10년 전 조회 768
10년 전 조회 1,122
10년 전 조회 566
10년 전 조회 800
10년 전 조회 808
10년 전 조회 633
10년 전 조회 572
10년 전 조회 553
10년 전 조회 649
10년 전 조회 424
10년 전 조회 456
10년 전 조회 674
10년 전 조회 506
10년 전 조회 461
10년 전 조회 461
10년 전 조회 473
10년 전 조회 468
10년 전 조회 450
10년 전 조회 450
10년 전 조회 481
10년 전 조회 588
10년 전 조회 420
10년 전 조회 445
10년 전 조회 525
10년 전 조회 1,266
10년 전 조회 482
10년 전 조회 473
10년 전 조회 596
10년 전 조회 490
10년 전 조회 662
10년 전 조회 591
10년 전 조회 472
10년 전 조회 475
10년 전 조회 528
10년 전 조회 517
10년 전 조회 412
10년 전 조회 410
10년 전 조회 374
10년 전 조회 420
10년 전 조회 818
10년 전 조회 419
10년 전 조회 536
10년 전 조회 449
10년 전 조회 649
10년 전 조회 468
10년 전 조회 382
10년 전 조회 428
10년 전 조회 449
10년 전 조회 574
10년 전 조회 523
🐛 버그신고