it is probably very simple, but I canβt understand :)
$('#myDiv').html('<a onclick="remove_item(variantId);">Remove</a>');
variantId is a JS variable, so I need to pass it to the code above.
$('#myDiv').html('<a onclick="remove_item(' + variantId + ');">Remove</a>');
use it that way -
$('#myDiv').html('<a onclick="remove_item('+variantId+');">Remove</a>');
Source: https://habr.com/ru/post/1785031/More articles:Blending the business logic of stored procedures and ORM - .netPyAudio is trying to use JACK - pythonJSF vs plain JSP + Beans? - java-eeSQL Server 2000 - How to rotate join results in final query results? - sql-serverDocument Management System - Database Design - javaOpenGL basics: calling glDrawElements once per object - pythondll of a working environment with a specific culture that does not work in the .NET environment when the application is installed using the cab file - c #XSLT: conditionally add a substring modification - xmlEquivalent to Flash BitmapData.hitTest () in HTML5 JavaScript - javascriptSetting line spacing for Word 2007 in the Neutral Path plan - c #All Articles