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

· 10년 전 · 374

<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년 전 조회 390
10년 전 조회 343
10년 전 조회 355
10년 전 조회 351
10년 전 조회 314
10년 전 조회 319
10년 전 조회 525
10년 전 조회 742
10년 전 조회 552
10년 전 조회 357
10년 전 조회 349
10년 전 조회 316
10년 전 조회 327
10년 전 조회 438
10년 전 조회 356
10년 전 조회 284
10년 전 조회 332
10년 전 조회 717
10년 전 조회 1,183
10년 전 조회 743
10년 전 조회 536
10년 전 조회 515
10년 전 조회 398
10년 전 조회 373
10년 전 조회 382
10년 전 조회 352
10년 전 조회 377
10년 전 조회 392
10년 전 조회 522
10년 전 조회 432
10년 전 조회 1,161
10년 전 조회 714
10년 전 조회 441
10년 전 조회 515
10년 전 조회 783
10년 전 조회 495
10년 전 조회 622
10년 전 조회 460
10년 전 조회 573
10년 전 조회 402
10년 전 조회 382
10년 전 조회 386
10년 전 조회 442
10년 전 조회 398
10년 전 조회 459
10년 전 조회 450
10년 전 조회 432
10년 전 조회 597
10년 전 조회 609
10년 전 조회 375
10년 전 조회 672
10년 전 조회 1,022
10년 전 조회 481
10년 전 조회 700
10년 전 조회 705
10년 전 조회 531
10년 전 조회 486
10년 전 조회 448
10년 전 조회 546
10년 전 조회 322
10년 전 조회 352
10년 전 조회 573
10년 전 조회 409
10년 전 조회 372
10년 전 조회 356
10년 전 조회 378
10년 전 조회 376
10년 전 조회 357
10년 전 조회 364
10년 전 조회 394
10년 전 조회 486
10년 전 조회 326
10년 전 조회 364
10년 전 조회 441
10년 전 조회 1,168
10년 전 조회 377
10년 전 조회 372
10년 전 조회 497
10년 전 조회 375
10년 전 조회 548
10년 전 조회 490
10년 전 조회 375
10년 전 조회 371
10년 전 조회 425
10년 전 조회 423
10년 전 조회 311
10년 전 조회 315
10년 전 조회 270
10년 전 조회 323
10년 전 조회 722
10년 전 조회 340
10년 전 조회 443
10년 전 조회 363
10년 전 조회 559
10년 전 조회 372
10년 전 조회 309
10년 전 조회 337
10년 전 조회 358
10년 전 조회 485
10년 전 조회 436
🐛 버그신고