JSFiddle - React, Tailwind, and code Playground

HTML

<a id="previous" href="#">prev</a>

<div id="r"></div>

JavaScript

function show(s)
{
  $("#r").append((s == undefined ? "undefined" : s));
  $("#r").append("<br/>");
}

// Try to retrieve the control attribute
show($("#previous").attr("control"));

// Set the control attribute
$("#previous").attr("control", "-6");

// Retrieve the control attribute
show($("#previous").attr("control"));