The HTMLInputElement.setRangeText() method replaces a range of text in an or element with a new string.</p><p class="paragraph"><a href="https://developer.mozilla.org/docs/Web/API/HTMLInputElement/setRangeText">MDN Reference</a></p><hr><div class="symbol monospace"><span class="token keyword">open </span><span class="token keyword">external </span><span class="token keyword">fun </span><a href="set-range-text.html"><span class="token function">setRangeText</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">replacement<span class="token operator">: </span><a href="https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html">String</a><span class="token punctuation">, </span></span><span class="parameter ">start<span class="token operator">: </span><a href="https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html">Int</a><span class="token punctuation">, </span></span><span class="parameter ">end<span class="token operator">: </span><a href="https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html">Int</a><span class="token punctuation">, </span></span><span class="parameter ">selectionMode<span class="token operator">: </span><a href="../-selection-mode/index.html">SelectionMode</a><span class="token operator"> = </span>definedExternally</span></span><span class="token punctuation">)</span><span class="source-link-wrapper"><span class="source-link" data-element-type="source-link">(<a href="https://github.com/JetBrains/kotlin-wrappers//tree/master/kotlin-browser/src/webMain/generated/web/html/HTMLInputElement.kt#L397">source</a>)</span></span></div></div> </div> </div> <div class="footer"> <div class="footer--container"> <a href="#content" id="go-to-top-link" class="footer--button footer--button_go-to-top"></a> <div class="footer--content"> <div> <span>Generated by </span> <a class="footer--link footer--link_external" href="https://github.com/Kotlin/dokka"> Dokka </a> <div>© 2026 Copyright</div> </div> </div> </div> </div> </div> </div> </div> </body> </html>
HTMLInputElement.setRangeText()