WebView.SetFocus
----------------

Sets focus to web viewer.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [WebView](component_WebView.md) | [9.4](newinversion94.md) | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ✅ Yes |

MBS( "WebView.SetFocus"; WebViewerRef ) 

**MBS**( **"WebView.SetFocus";** /\* Sets focus to web viewer. \*/  
**$WebViewerRef**) /\* Either the Web Viewer Object Name or the Web Viewer ID as returned by "[WebView.FindByName](WebViewFindByName.md)" function. \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| WebViewerRef | Either the Web Viewer Object Name or the Web Viewer ID as returned by "[WebView.FindByName](WebViewFindByName.md)" function. |  |

### Result

Returns OK or error.

### Description

Sets focus to web viewer.  
Usually you use Go To Object, but this sets via OS function directly.  
FileMaker may overwrite the focus quickly!  
### Examples

Set focus to web viewer:

 Set Variable \[ $r ; Value: MBS ("WebView.SetFocus"; "web") \]  
### See also

- [Preview.SetFocus](PreviewSetFocus.md)
- [TextView.SetFocus](TextViewSetFocus.md)
- [WebView.FindByName](WebViewFindByName.md)
- [WebView.GetForm](WebViewGetForm.md)
- [WebView.MoveFocus](WebViewMoveFocus.md)
- [WebView.SetZoom](WebViewSetZoom.md)

### Release notes

- **Version 11.2**
    - Fixed [WebView.SetFocus](https://www.mbsplugins.eu/WebViewSetFocus.shtml) for iOS.
- **Version 9.4**
    - Added [WebView.SetFocus](http://www.mbsplugins.eu/WebViewSetFocus.shtml) function.

### Blog Entries

- [MBS FileMaker Plugin, version 11.2pr5](https://www.mbsplugins.de/archive/2021-05-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 9.4pr7](https://www.mbsplugins.de/archive/2019-09-12/MBS_FileMaker_Plugin_version_9/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 11st September 2019 , last changed 26th September 2023

  
[WebView.SetEditable](WebViewSetEditable.md) - [WebView.SetFormButtonValue](WebViewSetFormButtonValue.md)

[HTML Version](WebViewSetFocus.shtml)