# Get content with EvaluateJS

**URL:** <https://forums.fusetools.com/t/get-content-with-evaluatejs/5644>\
**Category:** How-to Discussions\
**Created:** [January 17, 2018, 8:36am UTC](https://forums.fusetools.com/t/get-content-with-evaluatejs/5644 "2018-01-17T08:36:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shabby](https://avatars.discourse-cdn.com/v4/letter/s/a6a055/32.png) [@Shabby](https://forums.fusetools.com/u/Shabby)\
**Post date:** [January 17, 2018, 8:36am UTC](https://forums.fusetools.com/t/get-content-with-evaluatejs/5644/1 "2018-01-17T08:36:14Z")

</div>

I’m wondering if it’s any possibility to get content from NativeWebView with Fuse element. For example, user writes something in textarea which is shown as a WebView and then when user clicks on the Fuse button element so will Fuse get the content of textarea.

I can get the content of textarea with EvaluateJS as shown in examples. Is it possible to do what I’m asking for?

---

<div class="post-metadata">

**Author:** ![Uldis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/uldis/32/657_2.png) [@Uldis](https://forums.fusetools.com/u/Uldis)\
**Post date:** [January 17, 2018, 8:58am UTC](https://forums.fusetools.com/t/get-content-with-evaluatejs/5644/2 "2018-01-17T08:58:19Z")

</div>

Yes, theoretically you should be able to do that, as the [EvaluateJS example](https://www.fusetools.com/docs/fuse/triggers/actions/evaluatejs#example) explains.

If you have trouble figuring out where in the DOM your textarea lives, I suggest trying to return the whole `document` and `console.log()` everything you get there.

---

<div class="post-metadata">

**Author:** ![Shabby](https://avatars.discourse-cdn.com/v4/letter/s/a6a055/32.png) [@Shabby](https://forums.fusetools.com/u/Shabby)\
**Post date:** [January 17, 2018, 1:09pm UTC](https://forums.fusetools.com/t/get-content-with-evaluatejs/5644/3 "2018-01-17T13:09:42Z")

</div>

It worked really well with UserEvent, example:

```auto
<NativeViewHost ux:Name="nvh" Visibility="Visible">
	<WebView Url="http://localhost/textarea.html" ZoomEnabled="false" Margin="0,60,0,0" MaxWidth="340" Height="320">
		<UserEvent ux:Name="getContentEvent" />

		<OnUserEvent EventName="getContentEvent">
			<EvaluateJS Handler="{onPageLoaded}">
				var result = {
				body : document.forms[0]["children"][1]["children"][0].innerHTML
				};

				return result;
			</EvaluateJS>
		</OnUserEvent>
	</WebView>
</NativeViewHost>
<MyButton Text="GET" Clicked="{getThis}" Alignment="BottomLeft" Margin="10,0,10,10" />

```

```auto
function onPageLoaded(res) {
	console.log(res['json']);
}

function getThis() {
	getContentEvent.raise();
}

```
