title: JointJS - how to change the content of a joint.elementTools.Button when clicked
body: <p>I used the example code to create an info button (<a href="https://resources.jointjs.com/tutorial/element-tools" rel="nofollow noreferrer">https://resources.jointjs.com/tutorial/element-tools</a>). But I would like it to change when clicked. (I actually modified the example to show a &quot;+&quot; instead of a blue info circle, by using <code>text</code> and <code>textContent</code> instead of a <code>path</code> in the <code>markup</code> definition. But I would be happy to learn how to make the original example change when clicked, too.)</p>
  <p>So when you click it I want it to show some info and change to a &quot;-&quot;. And then if you click the &quot;-&quot;, change back to a &quot;+&quot;. I don't see how to change the <code>textContent</code> of the <code>elementTools.Button</code> programmatically or in an event. It was easy enough to change the label of the associated <code>Rectangle</code>. Inside the event I just did <code>this.model.attr(&quot;label/text&quot;, &quot;whatever&quot;)</code>. But how to do it to the element tool Button?</p>
  <p>There is an example that's pretty good, using a custom element containing subelements not tools (halfway through <a href="https://resources.jointjs.com/tutorial/events" rel="nofollow noreferrer">https://resources.jointjs.com/tutorial/events</a>). Does it mean I can't use an element tool, that element tools can't change on an event?</p>