How to load image inside HTML Buttons
I have one button inside webview as :
return INPUT TYPE=\"button\" type = \"image\" src = \"file:///android_asset//ui_btn_next.png\" NAME=\"Viewer2\" VALUE=\"Next\" onClick=\"window.Question.OnJsClick_Next()\">";
I want image inside button. I have that image inside asset folder. How can I access that image inside that button.
I have tried :
Way 1: return INPUT TYPE=\"button\" type = \开发者_如何学Python"image\" src = \"file:///android_asset//ui_btn_next.png\" NAME=\"Viewer2\" VALUE=\"Next\" onClick=\"window.Question.OnJsClick_Next()\">";
Way 2: return "<INPUT TYPE=\"button\" type =\"image\" <style> #myImage { background-image: url(\"file:///android_asset/myImage.jpg\"; width: 250px; height: 50px;}\" VALUE=\"Next\" onClick=\"window.Question.OnJsClick_Next()\">";
Way3 :return "INPUT TYPE=\"button\" type =\"image\" img src=\"file:///android_res/drawable/btn_next.png VALUE=\"Next\" onClick=\"window.Question.OnJsClick_Next()\">";
But no luck.. Can anyone help me out of this. Thanks in advance..
This a HTML/CSS question.
<input type="image" src="images.jpg" value="Next" alt="Next">
Should work.
You're setting the "type" attribute several times. Which of course won't work :)
You can use this one too:
<button id="Next"><img src="myimage.jpg"/>Next</button>
精彩评论