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

· 10년 전 · 397

<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년 전 조회 416
10년 전 조회 369
10년 전 조회 382
10년 전 조회 376
10년 전 조회 345
10년 전 조회 345
10년 전 조회 557
10년 전 조회 766
10년 전 조회 580
10년 전 조회 381
10년 전 조회 376
10년 전 조회 346
10년 전 조회 354
10년 전 조회 468
10년 전 조회 383
10년 전 조회 305
10년 전 조회 355
10년 전 조회 743
10년 전 조회 1,207
10년 전 조회 774
10년 전 조회 562
10년 전 조회 541
10년 전 조회 414
10년 전 조회 398
10년 전 조회 410
10년 전 조회 376
10년 전 조회 402
10년 전 조회 422
10년 전 조회 556
10년 전 조회 462
10년 전 조회 1,184
10년 전 조회 743
10년 전 조회 465
10년 전 조회 542
10년 전 조회 804
10년 전 조회 518
10년 전 조회 650
10년 전 조회 492
10년 전 조회 599
10년 전 조회 430
10년 전 조회 406
10년 전 조회 406
10년 전 조회 461
10년 전 조회 423
10년 전 조회 480
10년 전 조회 472
10년 전 조회 458
10년 전 조회 619
10년 전 조회 628
10년 전 조회 397
10년 전 조회 691
10년 전 조회 1,041
10년 전 조회 503
10년 전 조회 726
10년 전 조회 727
10년 전 조회 557
10년 전 조회 502
10년 전 조회 469
10년 전 조회 567
10년 전 조회 340
10년 전 조회 378
10년 전 조회 594
10년 전 조회 427
10년 전 조회 393
10년 전 조회 374
10년 전 조회 391
10년 전 조회 397
10년 전 조회 373
10년 전 조회 382
10년 전 조회 415
10년 전 조회 506
10년 전 조회 345
10년 전 조회 380
10년 전 조회 454
10년 전 조회 1,186
10년 전 조회 401
10년 전 조회 388
10년 전 조회 514
10년 전 조회 390
10년 전 조회 568
10년 전 조회 505
10년 전 조회 391
10년 전 조회 387
10년 전 조회 437
10년 전 조회 435
10년 전 조회 327
10년 전 조회 330
10년 전 조회 285
10년 전 조회 339
10년 전 조회 736
10년 전 조회 353
10년 전 조회 452
10년 전 조회 376
10년 전 조회 572
10년 전 조회 383
10년 전 조회 320
10년 전 조회 346
10년 전 조회 370
10년 전 조회 492
10년 전 조회 443
🐛 버그신고