How to click button using stringByEvaluatingJavaScriptFromString in cocoa


I want to click on button automatically using UIWebview stringByEvaluatingJavaScriptFromString HTML Source

<input type="image" src="image.gif" alt="sign-in" onclick="return check_form();" value=" Enter " tabindex="3"/>

I tried directly calling function name but it is not working. Can anyone help me ?

[webView stringByEvaluatingJavaScriptFromString:@"check_form()"];


The piece of JavaScript you are looking for is:


Make sure to add id="check_form_button" to your button.

This video can help you solving your question :)
By: admin