How to get cookie value when $.cookie error come in console

How to solve error comes when trying to use cookie value store in the browser.


when trying to use a cookie value which stores in the browser by javascript and error come in browser console $.cookie is not define, so add jquery cookie library in HTML code. The library is mention below.


Include below jquery library after jQuery call

<script type=”text/javascript” src=””></script>

Detail code.

<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>

<script type="text/javascript">
var hubsportCookie = $.cookie('hubspot_marketplace'); 
if(hubsportCookie == 'hubspot'){
jQuery('#leadSource').val('Hubspot Marketplace');