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

· 10년 전 · 406

<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년 전 조회 430
10년 전 조회 382
10년 전 조회 396
10년 전 조회 388
10년 전 조회 354
10년 전 조회 356
10년 전 조회 567
10년 전 조회 779
10년 전 조회 586
10년 전 조회 390
10년 전 조회 383
10년 전 조회 356
10년 전 조회 364
10년 전 조회 479
10년 전 조회 396
10년 전 조회 317
10년 전 조회 364
10년 전 조회 755
10년 전 조회 1,214
10년 전 조회 786
10년 전 조회 575
10년 전 조회 552
10년 전 조회 423
10년 전 조회 409
10년 전 조회 420
10년 전 조회 385
10년 전 조회 414
10년 전 조회 434
10년 전 조회 566
10년 전 조회 470
10년 전 조회 1,198
10년 전 조회 757
10년 전 조회 479
10년 전 조회 556
10년 전 조회 813
10년 전 조회 530
10년 전 조회 662
10년 전 조회 505
10년 전 조회 611
10년 전 조회 443
10년 전 조회 417
10년 전 조회 418
10년 전 조회 474
10년 전 조회 436
10년 전 조회 489
10년 전 조회 482
10년 전 조회 472
10년 전 조회 631
10년 전 조회 637
10년 전 조회 407
10년 전 조회 700
10년 전 조회 1,055
10년 전 조회 511
10년 전 조회 737
10년 전 조회 741
10년 전 조회 569
10년 전 조회 512
10년 전 조회 481
10년 전 조회 580
10년 전 조회 356
10년 전 조회 392
10년 전 조회 609
10년 전 조회 440
10년 전 조회 407
10년 전 조회 390
10년 전 조회 405
10년 전 조회 404
10년 전 조회 380
10년 전 조회 393
10년 전 조회 423
10년 전 조회 519
10년 전 조회 359
10년 전 조회 392
10년 전 조회 464
10년 전 조회 1,202
10년 전 조회 413
10년 전 조회 404
10년 전 조회 528
10년 전 조회 409
10년 전 조회 588
10년 전 조회 521
10년 전 조회 405
10년 전 조회 402
10년 전 조회 454
10년 전 조회 450
10년 전 조회 342
10년 전 조회 348
10년 전 조회 301
10년 전 조회 353
10년 전 조회 753
10년 전 조회 366
10년 전 조회 469
10년 전 조회 390
10년 전 조회 584
10년 전 조회 394
10년 전 조회 332
10년 전 조회 357
10년 전 조회 379
10년 전 조회 502
10년 전 조회 452
🐛 버그신고