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

· 10년 전 · 355

<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년 전 조회 366
10년 전 조회 310
10년 전 조회 327
10년 전 조회 327
10년 전 조회 286
10년 전 조회 290
10년 전 조회 497
10년 전 조회 721
10년 전 조회 529
10년 전 조회 332
10년 전 조회 331
10년 전 조회 293
10년 전 조회 306
10년 전 조회 413
10년 전 조회 334
10년 전 조회 261
10년 전 조회 306
10년 전 조회 689
10년 전 조회 1,158
10년 전 조회 715
10년 전 조회 507
10년 전 조회 490
10년 전 조회 367
10년 전 조회 346
10년 전 조회 357
10년 전 조회 326
10년 전 조회 348
10년 전 조회 367
10년 전 조회 499
10년 전 조회 405
10년 전 조회 1,136
10년 전 조회 695
10년 전 조회 421
10년 전 조회 491
10년 전 조회 762
10년 전 조회 468
10년 전 조회 595
10년 전 조회 435
10년 전 조회 553
10년 전 조회 381
10년 전 조회 358
10년 전 조회 362
10년 전 조회 418
10년 전 조회 380
10년 전 조회 441
10년 전 조회 431
10년 전 조회 414
10년 전 조회 579
10년 전 조회 589
10년 전 조회 356
10년 전 조회 656
10년 전 조회 1,009
10년 전 조회 461
10년 전 조회 683
10년 전 조회 689
10년 전 조회 516
10년 전 조회 468
10년 전 조회 434
10년 전 조회 529
10년 전 조회 304
10년 전 조회 337
10년 전 조회 555
10년 전 조회 388
10년 전 조회 355
10년 전 조회 341
10년 전 조회 357
10년 전 조회 354
10년 전 조회 340
10년 전 조회 345
10년 전 조회 377
10년 전 조회 468
10년 전 조회 308
10년 전 조회 346
10년 전 조회 426
10년 전 조회 1,153
10년 전 조회 361
10년 전 조회 359
10년 전 조회 488
10년 전 조회 364
10년 전 조회 538
10년 전 조회 474
10년 전 조회 361
10년 전 조회 361
10년 전 조회 414
10년 전 조회 408
10년 전 조회 300
10년 전 조회 305
10년 전 조회 257
10년 전 조회 311
10년 전 조회 709
10년 전 조회 329
10년 전 조회 425
10년 전 조회 346
10년 전 조회 545
10년 전 조회 361
10년 전 조회 298
10년 전 조회 323
10년 전 조회 345
10년 전 조회 470
10년 전 조회 416
🐛 버그신고