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

· 10년 전 · 475

<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년 전 조회 500
10년 전 조회 443
10년 전 조회 457
10년 전 조회 461
10년 전 조회 414
10년 전 조회 430
10년 전 조회 642
10년 전 조회 847
10년 전 조회 660
10년 전 조회 457
10년 전 조회 458
10년 전 조회 421
10년 전 조회 436
10년 전 조회 541
10년 전 조회 483
10년 전 조회 386
10년 전 조회 439
10년 전 조회 829
10년 전 조회 1,285
10년 전 조회 853
10년 전 조회 650
10년 전 조회 629
10년 전 조회 492
10년 전 조회 473
10년 전 조회 495
10년 전 조회 460
10년 전 조회 477
10년 전 조회 507
10년 전 조회 636
10년 전 조회 543
10년 전 조회 1,286
10년 전 조회 839
10년 전 조회 552
10년 전 조회 626
10년 전 조회 889
10년 전 조회 612
10년 전 조회 739
10년 전 조회 576
10년 전 조회 689
10년 전 조회 518
10년 전 조회 500
10년 전 조회 493
10년 전 조회 543
10년 전 조회 513
10년 전 조회 564
10년 전 조회 557
10년 전 조회 543
10년 전 조회 706
10년 전 조회 711
10년 전 조회 476
10년 전 조회 779
10년 전 조회 1,137
10년 전 조회 584
10년 전 조회 815
10년 전 조회 822
10년 전 조회 646
10년 전 조회 584
10년 전 조회 570
10년 전 조회 663
10년 전 조회 441
10년 전 조회 471
10년 전 조회 690
10년 전 조회 524
10년 전 조회 474
10년 전 조회 474
10년 전 조회 483
10년 전 조회 482
10년 전 조회 462
10년 전 조회 469
10년 전 조회 500
10년 전 조회 600
10년 전 조회 437
10년 전 조회 461
10년 전 조회 538
10년 전 조회 1,285
10년 전 조회 496
10년 전 조회 489
10년 전 조회 623
10년 전 조회 509
10년 전 조회 687
10년 전 조회 609
10년 전 조회 497
10년 전 조회 496
10년 전 조회 551
10년 전 조회 536
10년 전 조회 434
10년 전 조회 427
10년 전 조회 388
10년 전 조회 442
10년 전 조회 842
10년 전 조회 441
10년 전 조회 560
10년 전 조회 468
10년 전 조회 674
10년 전 조회 488
10년 전 조회 404
10년 전 조회 450
10년 전 조회 476
10년 전 조회 600
10년 전 조회 540
🐛 버그신고