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

· 10년 전 · 370

<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년 전 조회 375
10년 전 조회 320
10년 전 조회 335
10년 전 조회 334
10년 전 조회 297
10년 전 조회 299
10년 전 조회 509
10년 전 조회 728
10년 전 조회 536
10년 전 조회 344
10년 전 조회 337
10년 전 조회 301
10년 전 조회 312
10년 전 조회 423
10년 전 조회 344
10년 전 조회 272
10년 전 조회 317
10년 전 조회 700
10년 전 조회 1,170
10년 전 조회 727
10년 전 조회 527
10년 전 조회 504
10년 전 조회 387
10년 전 조회 362
10년 전 조회 371
10년 전 조회 340
10년 전 조회 363
10년 전 조회 381
10년 전 조회 513
10년 전 조회 420
10년 전 조회 1,148
10년 전 조회 703
10년 전 조회 433
10년 전 조회 504
10년 전 조회 771
10년 전 조회 481
10년 전 조회 610
10년 전 조회 449
10년 전 조회 564
10년 전 조회 395
10년 전 조회 372
10년 전 조회 374
10년 전 조회 433
10년 전 조회 392
10년 전 조회 450
10년 전 조회 445
10년 전 조회 424
10년 전 조회 592
10년 전 조회 602
10년 전 조회 371
10년 전 조회 667
10년 전 조회 1,017
10년 전 조회 475
10년 전 조회 696
10년 전 조회 704
10년 전 조회 527
10년 전 조회 480
10년 전 조회 443
10년 전 조회 542
10년 전 조회 316
10년 전 조회 348
10년 전 조회 568
10년 전 조회 404
10년 전 조회 363
10년 전 조회 352
10년 전 조회 371
10년 전 조회 369
10년 전 조회 351
10년 전 조회 358
10년 전 조회 390
10년 전 조회 482
10년 전 조회 321
10년 전 조회 361
10년 전 조회 438
10년 전 조회 1,162
10년 전 조회 373
10년 전 조회 370
10년 전 조회 494
10년 전 조회 373
10년 전 조회 547
10년 전 조회 486
10년 전 조회 371
10년 전 조회 371
10년 전 조회 423
10년 전 조회 420
10년 전 조회 311
10년 전 조회 313
10년 전 조회 268
10년 전 조회 323
10년 전 조회 718
10년 전 조회 337
10년 전 조회 441
10년 전 조회 359
10년 전 조회 555
10년 전 조회 370
10년 전 조회 308
10년 전 조회 335
10년 전 조회 353
10년 전 조회 483
10년 전 조회 431
🐛 버그신고