Error in script

Hi…

I’m attempting to write a simple script to add an icon to a input button. I’ve followed the solution from another user but i’m getting the same error when previewing the page:

Bug in custom html:
SyntaxError: missing ) after argument list
at p (https://dhtiece9044ep.cloudfront.net/package/run_debug_js/922b668affff1a0bb5e9ecb3a316efa1cee5544d74e72fb388f0e564aae8adab/xfalse/x15/run_debug.js:2:523)

My script is this:

<script>
$(document).ready(function(){
$("#btnEmail").append($("<i class="fa-duotone fa-at" style="margin-right:5px"></i>")).button();
});
</script>

Hello,

I think what you are looking for is:

<script>
$(document).ready(function() {
$("#btnEmail").append('<i class="fa-duotone fa-at" style="margin-right:5px"></i>');
}); 
</script>

In case it helps, a more “Bubble” way to accomplish a button with an icon is to create a group and add a text element and icon inside of the group. Then you would make the entire group clickable and style it accordingly.

1 Like

Thanks @bubble.trouble… I follow your suggestion and it works like a charm.

This topic was automatically closed after 70 days. New replies are no longer allowed.