var p = document.getElementById('word');
NSString*html =@"var p = document.getElementById('word');"; NSString*html2 =@"p.remove();"; [webViewstringByEvaluatingJavaScriptFromString:html]; [webViewstringByEvaluatingJavaScriptFromString:html2];
NSString*htmlUpdate =@"var change = document.getElementsByClassName('change')[0];" "change.innerHTML = '更改后的值';"; [webViewstringByEvaluatingJavaScriptFromString:htmlUpdate];
//插入操作1
//插入操作2 NSString*htmlInsert =@"var img = document.createElement('img');" "img.src = 'img11.jpg';" "img.width = '200';" "img.height = '200';" "document.body.appendChild(img);"; [webViewstringByEvaluatingJavaScriptFromString:htmlInsert];
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
网友评论