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

· 10년 전 · 359

<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년 전 조회 314
10년 전 조회 329
10년 전 조회 328
10년 전 조회 288
10년 전 조회 291
10년 전 조회 499
10년 전 조회 722
10년 전 조회 530
10년 전 조회 334
10년 전 조회 332
10년 전 조회 295
10년 전 조회 308
10년 전 조회 416
10년 전 조회 336
10년 전 조회 262
10년 전 조회 308
10년 전 조회 693
10년 전 조회 1,160
10년 전 조회 717
10년 전 조회 511
10년 전 조회 495
10년 전 조회 369
10년 전 조회 351
10년 전 조회 362
10년 전 조회 329
10년 전 조회 349
10년 전 조회 370
10년 전 조회 500
10년 전 조회 409
10년 전 조회 1,137
10년 전 조회 697
10년 전 조회 424
10년 전 조회 492
10년 전 조회 763
10년 전 조회 471
10년 전 조회 596
10년 전 조회 439
10년 전 조회 557
10년 전 조회 384
10년 전 조회 361
10년 전 조회 365
10년 전 조회 420
10년 전 조회 381
10년 전 조회 444
10년 전 조회 432
10년 전 조회 415
10년 전 조회 583
10년 전 조회 591
10년 전 조회 360
10년 전 조회 658
10년 전 조회 1,010
10년 전 조회 463
10년 전 조회 684
10년 전 조회 693
10년 전 조회 517
10년 전 조회 470
10년 전 조회 435
10년 전 조회 529
10년 전 조회 305
10년 전 조회 339
10년 전 조회 556
10년 전 조회 393
10년 전 조회 357
10년 전 조회 343
10년 전 조회 360
10년 전 조회 359
10년 전 조회 341
10년 전 조회 347
10년 전 조회 382
10년 전 조회 472
10년 전 조회 309
10년 전 조회 349
10년 전 조회 426
10년 전 조회 1,155
10년 전 조회 365
10년 전 조회 361
10년 전 조회 488
10년 전 조회 365
10년 전 조회 539
10년 전 조회 475
10년 전 조회 362
10년 전 조회 361
10년 전 조회 415
10년 전 조회 409
10년 전 조회 300
10년 전 조회 307
10년 전 조회 257
10년 전 조회 313
10년 전 조회 711
10년 전 조회 330
10년 전 조회 427
10년 전 조회 349
10년 전 조회 546
10년 전 조회 363
10년 전 조회 299
10년 전 조회 323
10년 전 조회 346
10년 전 조회 473
10년 전 조회 417
🐛 버그신고