Search code examples
javascriptjquerysvgjquery-svg

what does .svg('get') mean?


I have seen this syntax in many places, but cannot find any explanation on internet what does this two lines do, could anyone explain it?

$('#svgContainer').svg();           
var svg = $('#svgContainer').svg('get');

Solution

  • This looks like a plugin for jQuery that creates (first line) and then returns (second line) a SVG element. Possibly this one?

    From that plugin's documentation (found by clicking on 'Quick Ref'):

    $(selector).svg('get') // Retrieve SVG wrapper