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

· 10년 전 · 371

<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년 전 조회 378
10년 전 조회 324
10년 전 조회 339
10년 전 조회 336
10년 전 조회 299
10년 전 조회 300
10년 전 조회 510
10년 전 조회 729
10년 전 조회 537
10년 전 조회 345
10년 전 조회 337
10년 전 조회 302
10년 전 조회 313
10년 전 조회 424
10년 전 조회 344
10년 전 조회 273
10년 전 조회 318
10년 전 조회 700
10년 전 조회 1,170
10년 전 조회 730
10년 전 조회 527
10년 전 조회 504
10년 전 조회 387
10년 전 조회 363
10년 전 조회 371
10년 전 조회 341
10년 전 조회 364
10년 전 조회 381
10년 전 조회 513
10년 전 조회 420
10년 전 조회 1,148
10년 전 조회 704
10년 전 조회 434
10년 전 조회 505
10년 전 조회 773
10년 전 조회 481
10년 전 조회 612
10년 전 조회 450
10년 전 조회 564
10년 전 조회 395
10년 전 조회 373
10년 전 조회 375
10년 전 조회 434
10년 전 조회 393
10년 전 조회 451
10년 전 조회 445
10년 전 조회 425
10년 전 조회 592
10년 전 조회 603
10년 전 조회 372
10년 전 조회 668
10년 전 조회 1,018
10년 전 조회 477
10년 전 조회 697
10년 전 조회 704
10년 전 조회 528
10년 전 조회 480
10년 전 조회 444
10년 전 조회 543
10년 전 조회 318
10년 전 조회 349
10년 전 조회 568
10년 전 조회 404
10년 전 조회 367
10년 전 조회 353
10년 전 조회 372
10년 전 조회 372
10년 전 조회 352
10년 전 조회 358
10년 전 조회 390
10년 전 조회 482
10년 전 조회 321
10년 전 조회 361
10년 전 조회 438
10년 전 조회 1,164
10년 전 조회 373
10년 전 조회 372
10년 전 조회 494
10년 전 조회 374
10년 전 조회 547
10년 전 조회 488
10년 전 조회 375
10년 전 조회 371
10년 전 조회 424
10년 전 조회 423
10년 전 조회 311
10년 전 조회 314
10년 전 조회 268
10년 전 조회 323
10년 전 조회 719
10년 전 조회 338
10년 전 조회 441
10년 전 조회 361
10년 전 조회 558
10년 전 조회 370
10년 전 조회 309
10년 전 조회 336
10년 전 조회 355
10년 전 조회 485
10년 전 조회 432
🐛 버그신고