[html]
<html>
<head>
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".button1").click(function(){
var relval = $(this).attr(‘rel’);
$(‘p[class="p1"]’).each(function() {
if ($(this).attr(‘rel’)==relval){
$(this).text("a button is clicked");
}
});
});
});
</script>
</head>
<body>

<button class="button1" rel="rel1">button1</button>
<button class="button1" rel="rel2">button2</button>
<p class="p1" rel="rel1" >no button clicked</p >
<p class="p1" rel="rel2" >no button clicked</p >
</body>
</html>
[/html]