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

· 10년 전 · 405

<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년 전 조회 429
10년 전 조회 381
10년 전 조회 395
10년 전 조회 385
10년 전 조회 353
10년 전 조회 353
10년 전 조회 566
10년 전 조회 777
10년 전 조회 585
10년 전 조회 388
10년 전 조회 381
10년 전 조회 355
10년 전 조회 362
10년 전 조회 477
10년 전 조회 393
10년 전 조회 316
10년 전 조회 363
10년 전 조회 754
10년 전 조회 1,213
10년 전 조회 785
10년 전 조회 574
10년 전 조회 551
10년 전 조회 422
10년 전 조회 408
10년 전 조회 418
10년 전 조회 383
10년 전 조회 414
10년 전 조회 433
10년 전 조회 565
10년 전 조회 470
10년 전 조회 1,196
10년 전 조회 756
10년 전 조회 476
10년 전 조회 555
10년 전 조회 812
10년 전 조회 529
10년 전 조회 661
10년 전 조회 504
10년 전 조회 610
10년 전 조회 442
10년 전 조회 415
10년 전 조회 417
10년 전 조회 473
10년 전 조회 435
10년 전 조회 487
10년 전 조회 481
10년 전 조회 471
10년 전 조회 630
10년 전 조회 637
10년 전 조회 406
10년 전 조회 700
10년 전 조회 1,055
10년 전 조회 510
10년 전 조회 737
10년 전 조회 741
10년 전 조회 569
10년 전 조회 509
10년 전 조회 481
10년 전 조회 579
10년 전 조회 355
10년 전 조회 391
10년 전 조회 608
10년 전 조회 439
10년 전 조회 407
10년 전 조회 389
10년 전 조회 404
10년 전 조회 404
10년 전 조회 379
10년 전 조회 391
10년 전 조회 422
10년 전 조회 518
10년 전 조회 359
10년 전 조회 389
10년 전 조회 462
10년 전 조회 1,202
10년 전 조회 413
10년 전 조회 404
10년 전 조회 527
10년 전 조회 408
10년 전 조회 587
10년 전 조회 520
10년 전 조회 404
10년 전 조회 402
10년 전 조회 453
10년 전 조회 450
10년 전 조회 341
10년 전 조회 346
10년 전 조회 300
10년 전 조회 351
10년 전 조회 752
10년 전 조회 365
10년 전 조회 468
10년 전 조회 389
10년 전 조회 583
10년 전 조회 394
10년 전 조회 331
10년 전 조회 356
10년 전 조회 379
10년 전 조회 501
10년 전 조회 452
🐛 버그신고