skip to Main Content
<span id="product_wished_id">value</span>

I want to get that value and store it in liquid variable.

for example : {% assign myvalue = ? %}

Is there no way to getting an html element value and store it in liquid variable? to perform if else statement in liquid?

2

Answers


  1. No. Liquid code executes on server.

    Login or Signup to reply.
  2. Actually ,Liquid primarily operates on server-side , so it does not have access to your client-side i.e your DOM due to which it is not possible to use liquid alone to extract html value and store it in liquid variable.
    If you need to perform client-side operations like extracting values from HTML elements then use those values in conditional statements ,and than you can use javascript .

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search