# Deleting text of an input field, Solution that works in all the browsers

**URL:** <https://forum.katalon.com/t/deleting-text-of-an-input-field-solution-that-works-in-all-the-browsers/32769>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [September 9, 2019, 11:15am UTC](https://forum.katalon.com/t/deleting-text-of-an-input-field-solution-that-works-in-all-the-browsers/32769 "2019-09-09T11:15:31Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Russ\_Thomas](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/russ_thomas/32/11884_2.png) [@Russ\_Thomas](https://forum.katalon.com/u/Russ_Thomas)\
**Post date:** [September 9, 2019, 2:06pm UTC](https://forum.katalon.com/t/deleting-text-of-an-input-field-solution-that-works-in-all-the-browsers/32769/3 "2019-09-09T14:06:09Z")

</div>

This should work everywhere. If not, the internet is broken, the world is coming to an end, find a cave and stay there 😕

```javascript
String js = 'document.querySelector("[name=my_input]").value = "";'
WebUI.executeJavaScript(js, null)

```

If the input has an id attribute:

```javascript
String js = 'document.querySelector("#my_input").value = "";'
WebUI.executeJavaScript(js, null)

```

Good luck. (but you shouldn’t need it)

---

_[View the full topic](https://forum.katalon.com/t/deleting-text-of-an-input-field-solution-that-works-in-all-the-browsers/32769)._
