I want to change the position of an HTML element inside a UIWebView when I click a button. I have written the following code for that but it doesnt seem to work. Anyone know what I could be doing wrong?
NSString *str = [NSString stringWithFormat:@"function setOffset() {\
var offset = document.getElementById('cimage').offset();\
document.getElementById('cimage').offset({ top: offset.top-50, left: offset.left});\
setOffset();"];
[self.webView stringByEvaluatingJavaScriptFromString:str];