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

· 10년 전 · 360

<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년 전 조회 369
10년 전 조회 315
10년 전 조회 329
10년 전 조회 329
10년 전 조회 289
10년 전 조회 292
10년 전 조회 500
10년 전 조회 722
10년 전 조회 531
10년 전 조회 334
10년 전 조회 334
10년 전 조회 295
10년 전 조회 308
10년 전 조회 417
10년 전 조회 337
10년 전 조회 263
10년 전 조회 309
10년 전 조회 693
10년 전 조회 1,162
10년 전 조회 717
10년 전 조회 514
10년 전 조회 495
10년 전 조회 371
10년 전 조회 351
10년 전 조회 362
10년 전 조회 329
10년 전 조회 351
10년 전 조회 370
10년 전 조회 502
10년 전 조회 410
10년 전 조회 1,140
10년 전 조회 698
10년 전 조회 425
10년 전 조회 493
10년 전 조회 763
10년 전 조회 473
10년 전 조회 597
10년 전 조회 440
10년 전 조회 557
10년 전 조회 384
10년 전 조회 361
10년 전 조회 366
10년 전 조회 422
10년 전 조회 382
10년 전 조회 445
10년 전 조회 433
10년 전 조회 416
10년 전 조회 584
10년 전 조회 592
10년 전 조회 361
10년 전 조회 659
10년 전 조회 1,011
10년 전 조회 464
10년 전 조회 684
10년 전 조회 696
10년 전 조회 517
10년 전 조회 471
10년 전 조회 436
10년 전 조회 533
10년 전 조회 306
10년 전 조회 340
10년 전 조회 558
10년 전 조회 396
10년 전 조회 357
10년 전 조회 345
10년 전 조회 362
10년 전 조회 360
10년 전 조회 343
10년 전 조회 349
10년 전 조회 382
10년 전 조회 472
10년 전 조회 311
10년 전 조회 349
10년 전 조회 426
10년 전 조회 1,155
10년 전 조회 366
10년 전 조회 363
10년 전 조회 489
10년 전 조회 367
10년 전 조회 540
10년 전 조회 476
10년 전 조회 362
10년 전 조회 363
10년 전 조회 417
10년 전 조회 410
10년 전 조회 302
10년 전 조회 308
10년 전 조회 258
10년 전 조회 314
10년 전 조회 714
10년 전 조회 330
10년 전 조회 428
10년 전 조회 349
10년 전 조회 546
10년 전 조회 365
10년 전 조회 300
10년 전 조회 325
10년 전 조회 348
10년 전 조회 474
10년 전 조회 418
🐛 버그신고