0

I am developing a simple project using bootstrap. I have this code that can create a button inside a dataTable and it is working fine. I try to put an image to it not glyphicons by the code that I provided below as you can see.. But it's not working. But the glyphicon icon in First button is working.

{ data: "ActionMenu", title: "Test", sClass: "alignCenter","mRender": function (data) {
   return '<button type="button" class="btn btn-info btn-md action" id="checkId"><i class="fa fa-dollar fa-fw action"></i></button>'
   + '&nbsp; <button type="button" class="btn btn-danger btn-md action" id="checkId2" src="Images/TestPicture.png"></button>';
}
2
  • "But it's not working" what do you mean ? can you see the image if you access to it directly ? does the console say anything ? Commented Feb 16, 2017 at 8:11
  • @gobes I don't have any error in console. What I mean in not working the Image that I provided using the code is not displaying. Commented Feb 16, 2017 at 8:12

2 Answers 2

1

You can't give a src to a button element. Try to put an <img> element inside the button:

<button type="button" class="btn btn-danger btn-md action" id="checkId2">
    <img src="Images/TestPicture.png"/>
</button>
Sign up to request clarification or add additional context in comments.

Comments

1
 <button id="imageId type="button"><img src="path/of/image"></button>

Appy css with the help of ID if required

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.