<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<style> | |
input { | |
width: 200px; | |
font-size: 64px; | |
} | |
</style> | |
</head> | |
<body> | |
<input dir="rtl" value="[[مقاله]]"> | |
<p> | |
The last character (and only the last character) should be | |
selected in the text box above. | |
</p> | |
<script> | |
var el = document.getElementsByTagName('input')[0]; | |
el.focus(); | |
el.setSelectionRange(0, 1); | |
</script> | |
</body> | |
</html> |